<template>
  <!-- 派遣人员页面 -->
  <div>
    <!-- 搜索页面 -->
    <el-form
      :model="dispatchPersonnelSearch"
      size="small"
      :inline="true"
      class="query-form"
    >
      <el-form-item prop="narealNameme">
        <el-input
          size="small"
          v-model="dispatchPersonnelSearch.realName"
          autocomplete="off"
          placeholder="姓名"
        >
        </el-input>
      </el-form-item>
      <el-form-item prop="sex">
        <el-select
          v-model="dispatchPersonnelSearch.sex"
          placeholder="请选择性别"
          style="width: 100%"
          size="small"
        >
          <el-option label="男" value="男"></el-option>
          <el-option label="女" value="女"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item prop="phone">
        <el-input
          size="small"
          v-model="dispatchPersonnelSearch.phone"
          autocomplete="off"
          maxlength="11"
          placeholder="电话"
        ></el-input>
      </el-form-item>
      <el-form-item prop="sendenterprise">
        <el-input
          size="small"
          v-model="dispatchPersonnelSearch.sendenterprise"
          autocomplete="off"
          maxlength="11"
          placeholder="企业"
        ></el-input>
      </el-form-item>
      <el-form-item prop="currentAddress">
        <el-cascader
          placeholder="选择所在地（省、市）"
          value="dispatchPersonnelSearch.currentAddress"
          :props="{
            expandTrigger: 'hover',
            checkStrictly: true,
            label: 'name',
            value: 'name',
            children: 'children',
          }"
          size="small"
          ref="currentAddressChange"
          @change="handleChange"
          change-on-select
          clearable
          @click.native="handleSelect"
          :popper-class="'cascader1'"
          :options="valueData"
        >
        </el-cascader>
      </el-form-item>
      <el-form-item>
        <el-button size="small" type="primary" @click="searchUsers"
          >查询</el-button
        >
        <el-button
          size="small"
          style="margin-left: 10px"
          @click="resetsearchUsers"
          >重置</el-button
        >
      </el-form-item>
    </el-form>
    <!-- 内容页面 -->
    <div style="background-color: #fff; padding: 10px">
      <!-- 按钮 -->
      <div>
        <el-button
          size="small"
          icon="el-icon-circle-close"
          @click="deselectUserFound()"
          >取消选择</el-button
        >
        <el-button size="small" icon="el-icon-right" type="success"
          >数据统计</el-button
        >
      </div>
      <!-- 派遣人员数据表格 -->
      <div style="margin-top: 10px">
        <el-table
          v-loading="dispatchPersonnelLoading"
          row-key="id"
          :data="dispatchPersonnelTable"
          @selection-change="dispatchPersonnel"
          height="calc(100% - 80px)"
          size="small"
          ref="UserFounds"
          :cell-style="cellStyle"
          style="border: 1px solid #d6cfe2; min-height: 380px"
          :header-cell-class-name="cellHeadStyle"
          :row-class-name="tableRowClassName"
          :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
          class="table"
        >
          <el-table-column
            type="selection"
            width="55"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="realName"
            label="姓名"
            align="center"
            width="80"
            fixed="left"
            show-overflow-tooltip
          >
            <template slot-scope="scope">
              <el-link
                type="primary"
                :underline="false"
                @click="editPersonInfo(scope.row)"
                >{{ scope.row.realName }}</el-link
              >
            </template>
          </el-table-column>
          <el-table-column
            prop="sex"
            label="性别"
            width="60"
            show-overflow-tooltip
          ></el-table-column>
          <!-- :formatter="sexDictionaries" -->
          <el-table-column
            prop="age"
            label="年龄"
            width="60"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="sendenterprise.companyName"
            label="派遣企业"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="registerOffice"
            label="登记企业"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="department.name"
            label="部门"
            width="110"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="gwname"
            width="110"
            label="岗位"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column prop="phone" width="150" label="电话">
            <template slot-scope="scope">{{
              scope.row.phone
                ? scope.row.phone.replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3")
                : ""
            }}</template>
          </el-table-column>
          <!-- <el-table-column
            prop="idCard"
            label="身份证号"
            width="150"
            show-overflow-tooltip
          >
            <template slot-scope="scope">{{
              scope.row.idCard
                ? scope.row.idCard.replace(/^(\d{4})\d+(\d{4})$/, "$1****$2")
                : ""
            }}</template>
          </el-table-column>
          <el-table-column
            prop="email"
            label="邮箱"
            show-overflow-tooltip
          ></el-table-column> -->
          <el-table-column
            prop="currentAddress"
            label="现住址"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="loginRoot"
            label="注册来源"
            show-overflow-tooltip
          ></el-table-column>
        </el-table>
        <el-pagination
          @size-change="dispatchPersonnelHandleSize"
          @current-change="dispatchPersonnelHandleCurrent"
          :current-page.sync="dispatchPersonnelPageNo"
          :page-size="dispatchPersonnelPageSize"
          layout="total, prev, pager, next, jumper"
          :total="dispatchPersonnelTotal"
          style="margin: 1rem 0"
        >
        </el-pagination>
      </div>
      <el-dialog title="详情信息" :visible.sync="personInfoDialog" width="65%">
        <el-form :model="personInfo" size="small" ref="personInfo">
          <el-row :gutter="15">
            <el-col :span="6">
              <el-form-item label="姓名" prop="realName" label-width="110px">
                <el-input
                  v-model="personInfo.realName"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="性别" prop="sex" label-width="110px">
                <el-input
                  v-model="personInfo.sex"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="年龄" prop="age" label-width="110px">
                <el-input
                  v-model="personInfo.age"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="手机号" prop="phone" label-width="110px">
                <el-input
                  v-model="personInfo.phone"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="兴趣" prop="interest" label-width="110px">
                <el-input
                  v-model="personInfo.interest"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="驾照"
                prop="drivingLicense"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.drivingLicense"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="学历" prop="education" label-width="110px">
                <el-input
                  v-model="personInfo.education"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="毕业时间"
                prop="graduationdate"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.graduationdate"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="邮箱" prop="email" label-width="110px">
                <el-input
                  v-model="personInfo.email"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="身份证号码"
                prop="idCard"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.idCard"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="户籍"
                prop="householdRegister"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.householdRegister"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="籍贯" prop="nativeplace" label-width="110px">
                <el-input
                  v-model="personInfo.nativeplace"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="现住址"
                prop="currentAddress"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.currentAddress"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="工作经验年限"
                prop="workingYears"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.workingYears"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="开户行"
                prop="openingbank"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.openingbank"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="行号" prop="bankcard" label-width="110px">
                <el-input
                  v-model="personInfo.bankcard"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="求职状态"
                prop="jobSearchingStatus"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.jobSearchingStatus"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="期望行业" prop="gwname" label-width="110px">
                <el-input
                  v-model="personInfo.gwname"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="期望工作城市"
                prop="workingCity"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.workingCity"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="薪资要求"
                prop="salaryRequirements"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.salaryRequirements"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="工作企业"
                prop="sendenterprise.companyName"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.sendenterprise.companyName"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="部门"
                prop="department.name"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.department.name"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="岗位" prop="job" label-width="110px">
                <el-input
                  v-model="personInfo.job"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="聘用状态"
                prop="employmentStatus"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.employmentStatus"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="签订合同企业"
                prop="enterpriseInformation.companyName"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.enterpriseInformation.companyName"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="注册来源"
                prop="loginRoot"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.loginRoot"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="来源企业"
                prop="registerOffice"
                label-width="110px"
              >
                <el-input
                  v-model="personInfo.registerOffice"
                  autocomplete="off"
                  readonly
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button size="small" @click="personInfoDialog = false"
            >关闭</el-button
          >
        </span>
      </el-dialog>
      <!-- 附表选项卡 -->
      <div>
        <el-tabs
          type="border-card"
          @tab-click="handleClick"
          v-model="attachedListNum"
          style="margin-top: 20px"
        >
          <el-tab-pane label="历史工作记录">
            <!-- 历史工作记录按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="insertUserHirstyWorkDialog = true"
                :disabled="userId == ''"
                >新建
              </el-button>
              <el-button
                type="danger"
                size="small"
                icon="el-icon-delete"
                @click="delUserHirstyWorks"
                :disabled="checkUserHirstyWorks.length <= 0"
                >删除
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseHirstyWork()"
                >取消选择
              </el-button>
            </div>
            <!-- 历史工作记录数据表格 -->
            <el-table
              :data="worksExperienceTable"
              height="calc(100% - 80px)"
              size="small"
              @selection-change="selectUserHirstyWorks"
              ref="worksExperience"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              v-loading="UserHirstyWorkLoading"
              row-key="id"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="uname"
                align="center"
                label="姓名"
                fixed="left"
                width="80"
              ></el-table-column>
              <el-table-column
                prop="idCard"
                label="身份证号"
                width="110"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{
                  scope.row.idCard
                    ? scope.row.idCard.replace(
                        /^(\d{4})\d+(\d{4})$/,
                        "$1****$2"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="jobs"
                label="岗位"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="companyName"
                label="单位名称"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="startTime"
                label="工作开始时间"
                show-overflow-tooltip
                min-width="100"
              ></el-table-column>
              <el-table-column
                prop="endTime"
                label="工作结束时间"
                show-overflow-tooltip
                min-width="100"
              ></el-table-column>
              <el-table-column
                prop="isleaveOffice"
                label="是否正常离职"
                show-overflow-tooltip
                min-width="100"
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("yes_no", scope.row.isleaveOffice, '-') }}
                </template>
              </el-table-column>
              <el-table-column fixed="right" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="redactInsertUserHirstyWork(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delInsertUserHirstyWork(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <el-dialog
              title="新建历史工作记录"
              :visible.sync="insertUserHirstyWorkDialog"
              width="50%"
            >
              <el-form
                :model="insertUserHirstyWorkList"
                size="small"
                ref="insertUserHirstyWorkLists"
              >
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      label="开始时间"
                      prop="startTime"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '开始时间不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        style="width: 100%"
                        v-model="insertUserHirstyWorkList.startTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="选择日期时间"
                        format="yyyy-MM-dd HH:mm:ss"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="结束时间"
                      prop="endTime"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '结束时间不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        style="width: 100%"
                        v-model="insertUserHirstyWorkList.endTime"
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="选择日期时间"
                        format="yyyy-MM-dd HH:mm:ss"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="部门"
                      prop="department"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '部门不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="insertUserHirstyWorkList.department"
                        placeholder="请填写部门"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="岗位"
                      prop="jobs"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '岗位不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="insertUserHirstyWorkList.jobs"
                        placeholder="请填写岗位"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="是否正常离职"
                      prop="isleaveOffice"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '是否正常离职不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="insertUserHirstyWorkList.isleaveOffice"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('yes_no')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="单位名称"
                      prop="companyName"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '单位名称不能为空',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="insertUserHirstyWorkList.companyName"
                        placeholder="请填写单位名称"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <span slot="footer" class="dialog-footer">
                <el-button size="small" @click="closeInsertUserHirstyWorkDialog"
                  >取消</el-button
                >
                <el-button size="small" @click="insertUserHirstyWorks"
                  >确定</el-button
                >
              </span>
            </el-dialog>

            <el-dialog
              title="编辑历史工作记录"
              width="50%"
              :visible.sync="redactHirstyWorkDialog"
            >
              <el-form ref="redactHirstyWork" :model="redactHirstyWork">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="jobs"
                      label="岗位"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入岗位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactHirstyWork.jobs"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      label="部门"
                      prop="department"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '部门不能为空',
                          trigger: 'blur',
                        },
                      ]"
                      size="small"
                    >
                      <el-input
                        v-model="redactHirstyWork.department"
                        placeholder="请填写部门"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="companyName"
                      label="单位名称"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入单位名称',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactHirstyWork.companyName"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="startTime"
                      label="开始时间"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择开始时间',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactHirstyWork.startTime"
                        format="yyyy-MM-dd hh:mm:ss"
                        value-format="yyyy-MM-dd hh:mm:ss"
                        type="date"
                        style="width: 100%"
                        placeholder="选择开始工作时间"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="endTime"
                      label="结束时间"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择结束时间',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactHirstyWork.endTime"
                        format="yyyy-MM-dd hh:mm:ss"
                        value-format="yyyy-MM-dd hh:mm:ss"
                        type="date"
                        style="width: 100%"
                        placeholder="选择结束工作时间"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="isleaveOffice"
                      label="是否正常离职"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择是否正常离职',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-radio
                        v-model="redactHirstyWork.isleaveOffice"
                        label="0"
                        >是</el-radio
                      >
                      <el-radio
                        v-model="redactHirstyWork.isleaveOffice"
                        label="1"
                        >否</el-radio
                      >
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="redactHirstyWorkDialog = false"
                  >取 消</el-button
                >
                <el-button type="primary" @click="confirmHirstyWorks()"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="体检报告">
            <!-- 体检报告按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="addSaveHealthMangeDialog = true"
                :disabled="userId == ''"
                >添加
              </el-button>
              <el-button
                type="danger"
                size="small"
                icon="el-icon-delete"
                @click="delReports"
                :disabled="checkReports.length <= 0"
                >批量删除
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseReport()"
                >取消选择
              </el-button>
            </div>
            <!-- 体检报告数据表格 -->
            <el-table
              :data="medicalExaminationReportTable"
              height="calc(100% - 80px)"
              size="small"
              @selection-change="selectmedicalExaminationReport"
              ref="medicalExaminationReport"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              v-loading="medicalExaminationReportLoading"
              row-key="id"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="uname"
                label="姓名"
                align="center"
                fixed="left"
                width="80"
              ></el-table-column>
              <el-table-column
                prop="idcard"
                label="身份证号"
                width="110"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{
                  scope.row.idcard
                    ? scope.row.idcard.replace(
                        /^(\d{4})\d+(\d{4})$/,
                        "$1****$2"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="jobs"
                label="职位名称"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="inspectAddress"
                label="体检地点"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="inspectTime"
                label="体检日期"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="inspectReport"
                label="体检报告"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="company.companyName"
                label="公司名称"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="medicaltype"
                label="体检类型"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("medical_type", scope.row.medicaltype, '-') }}
                </template>
              </el-table-column>
              <el-table-column
                prop="medicalaccessory"
                label="体检附件"
                show-overflow-tooltip
              >
                <template slot-scope="scope" v-if="scope.row.medicalaccessory">
                  <a
                    :href="item"
                    target="_blank"
                    :key="index"
                    v-for="(item, index) in scope.row.medicalaccessory.split(
                      '|'
                    )"
                  >
                    {{
                      decodeURIComponent(
                        item.substring(item.lastIndexOf("/") + 1)
                      )
                    }}
                  </a>
                </template>
              </el-table-column>
              <el-table-column fixed="right" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="redactReport(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delReport(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <!-- 体检分页 -->
            <el-pagination
              @size-change="medicalExaminationReportHandleSize"
              @current-change="medicalExaminationReportHandleCurrent"
              :current-page.sync="medicalExaminationReportPageNo"
              :page-size="medicalExaminationReportPageSize"
              layout="total, prev, pager, next, jumper"
              :total="medicalExaminationReportTotal"
              style="margin: 1rem 0"
            >
            </el-pagination>

            <el-dialog
              title="新增体检报告"
              :visible.sync="addSaveHealthMangeDialog"
              width="50%"
            >
              <el-form ref="addSaveHealthMange" :model="addSaveHealthMange">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectTime"
                      label="体检日期"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="addSaveHealthMange.inspectTime"
                        type="date"
                        style="width: 100%"
                        format="yyyy-MM-dd"
                        value-format="yyyy-MM-dd"
                        placeholder="选择日期"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaltype"
                      label="体检类型"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择体检类型',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="addSaveHealthMange.medicaltype"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('medical_type')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectAddress"
                      label="体检地点"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检地点',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSaveHealthMange.inspectAddress"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectReport"
                      label="体检报告"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检报告',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSaveHealthMange.inspectReport"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicalaccessory"
                      label="体检附件"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请传入附件',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <!-- :on-preview="
					(file, fileList) => {
					$window.location.href =
						(file.response && file.response.url) || file.url;
					}
				" -->
                      <el-upload
                        ref="addHealthMangeUpload"
                        :action="`${this.$http.BASE_URL}/dlyrlTest/fileUpload`"
                        :headers="{ token: $cookie.get('token') }"
                        :on-preview="
                          (file) => {
                            $window.open(
                              (file.response && file.response.url) || file.url,
                              '_blank'
                            );
                          }
                        "
                        :on-success="
                          (response, file, fileList) => {
                            addSaveHealthMange.medicalaccessory = fileList
                              .map(
                                (item) =>
                                  (item.response && item.response.url) ||
                                  item.url
                              )
                              .join('|');
                          }
                        "
                        :on-remove="
                          (file, fileList) => {
                            $http
                              .post(
                                `/dlyrlTest/deleteFile?path=${
                                  (file.response && file.response.url) ||
                                  file.url
                                }`
                              )
                              .then(({ data }) => {
                                $message.success(data.msg);
                              });
                            addSaveHealthMange.medicalaccessory = fileList
                              .map((item) => item.url)
                              .join('|');
                          }
                        "
                        :before-remove="
                          (file, fileList) => {
                            return $confirm(`确定移除 ${file.name}？`);
                          }
                        "
                        multiple
                        :limit="5"
                        :on-exceed="
                          (files, fileList) => {
                            $message.warning(
                              `当前限制选择 5 个文件，本次选择了 ${
                                files.length
                              } 个文件，共选择了 ${
                                files.length + fileList.length
                              } 个文件`
                            );
                          }
                        "
                        :file-list="addSaveHealthMange.fileList"
                      >
                        <el-button size="small" type="primary"
                          >点击上传</el-button
                        >
                        <div slot="tip" class="el-upload__tip">
                          添加相关附件
                        </div>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="chooseAddsaveHealthManges">取 消</el-button>
                <el-button type="primary" @click="addsaveHealthManges"
                  >确 定</el-button
                >
              </div>
            </el-dialog>

            <el-dialog
              title="编辑体检报告"
              :visible.sync="redactHealthMangeDialog"
            >
              <el-form ref="redactHealthMange" :model="redactHealthMange">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectTime"
                      label="体检日期"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactHealthMange.inspectTime"
                        type="date"
                        style="width: 100%"
                        format="yyyy-MM-dd"
                        value-format="yyyy-MM-dd"
                        placeholder="选择日期"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaltype"
                      label="体检类型"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择体检类型',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="redactHealthMange.medicaltype"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in options"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectAddress"
                      label="体检地点"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检地点',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactHealthMange.inspectAddress"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="inspectReport"
                      label="体检报告"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入体检报告',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactHealthMange.inspectReport"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicalaccessory"
                      label="体检附件"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请传入附件',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-upload
                        ref="redactHealthMangeUpload"
                        :action="`${this.$http.BASE_URL}/dlyrlTest/fileUpload`"
                        :headers="{ token: $cookie.get('token') }"
                        :on-preview="
                          (file) => {
                            $window.open(
                              (file.response && file.response.url) || file.url,
                              '_blank'
                            );
                          }
                        "
                        :on-success="
                          (response, file, fileList) => {
                            redactHealthMange.medicalaccessory = fileList
                              .map(
                                (item) =>
                                  (item.response && item.response.url) ||
                                  item.url
                              )
                              .join('|');
                          }
                        "
                        :on-remove="
                          (file, fileList) => {
                            $http
                              .post(
                                `/dlyrlTest/deleteFile?path=${
                                  (file.response && file.response.url) ||
                                  file.url
                                }`
                              )
                              .then(({ data }) => {
                                $message.success(data.msg);
                              });
                            redactHealthMange.medicalaccessory = fileList
                              .map((item) => item.url)
                              .join('|');
                          }
                        "
                        :before-remove="
                          (file, fileList) => {
                            return $confirm(`确定移除 ${file.name}？`);
                          }
                        "
                        multiple
                        :limit="5"
                        :on-exceed="
                          (files, fileList) => {
                            $message.warning(
                              `当前限制选择 5 个文件，本次选择了 ${
                                files.length
                              } 个文件，共选择了 ${
                                files.length + fileList.length
                              } 个文件`
                            );
                          }
                        "
                        :file-list="redactHealthMange.fileList"
                      >
                        <el-button size="small" type="primary"
                          >点击上传</el-button
                        >
                        <div slot="tip" class="el-upload__tip">
                          添加相关附件
                        </div>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="redactHealthMangeDialog = false"
                  >取 消</el-button
                >
                <el-button type="primary" @click="confirmRedactHealthMange"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="考勤记录">
            <div>
              <el-date-picker
                v-model="checkingInPickerValue"
                format="yyyy-MM-dd"
                value-format="yyyy-MM-dd"
                type="date"
                size="small"
                @change="checkingInPicker"
                :clearable="false"
              >
              </el-date-picker>
            </div>
            <el-table
              :data="checkingInTable"
              height="calc(100% - 80px)"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              size="mini"
              v-loading="checkingInLoading"
              row-key="id"
            >
              <el-table-column
                prop="userinformation.realName"
                label="姓名"
                align="center"
                fixed="left"
                show-overflow-tooltip
                width="80"
              ></el-table-column>
              <el-table-column
                prop="userinformation.job"
                label="岗位"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="userinformation.idCard"
                label="身份证号"
                width="110"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{
                  scope.row.userinformation.idCard
                    ? scope.row.userinformation.idCard.replace(
                        /^(\d{4})\d+(\d{4})$/,
                        "$1****$2"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="checkinTime"
                label="打卡时间"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="longitude"
                label="经度"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="latitude"
                label="纬度"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="area"
                label="打卡地址"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="isType"
                label="签到/签退"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                    {{ $dictUtils.getDictLabel("is_checkin", scope.row.isType, '-') }}
                </template>
              </el-table-column>
              <el-table-column
                prop="normalTime"
                label="正常签到时间"
                show-overflow-tooltip
                min-width="100"
              ></el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="工伤记录">
            <!-- 工伤记录按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="addInjuryRecordDialog = true"
                :disabled="userId == ''"
                >添加
              </el-button>
              <el-button
                type="danger"
                size="small"
                icon="el-icon-delete"
                @click="delInjuryRecords"
                :disabled="checkInjuryRecords.length <= 0"
                >批量删除
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseInjuryRecord()"
                >取消选择
              </el-button>
            </div>
            <!-- 工伤记录数据表格 -->
            <el-table
              :data="injuryRecordTable"
              @selection-change="selectInjuryRecord"
              ref="injuryRecord"
              height="calc(100% - 80px)"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              size="mini"
              v-loading="injuryRecordLoading"
              row-key="id"
            >
              <el-table-column
                fixed
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="gname"
                label="姓名"
                align="center"
                fixed="left"
                width="80"
              ></el-table-column>
              <el-table-column
                prop="gidcard"
                label="身份证号"
                width="110"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{
                  scope.row.gidcard
                    ? scope.row.gidcard.replace(
                        /^(\d{4})\d+(\d{4})$/,
                        "$1****$2"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="gcompany.companyName"
                label="公司名称"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="createDate"
                label="创建时间"
                width="120"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="time"
                label="发生时间"
                width="120"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="commercialocation"
                label="工伤发生地点"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="businesslevel"
                label="工伤等级"
                width="100"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("business_level", scope.row.businesslevel, '-') }}
                </template>
              </el-table-column>
              <el-table-column
                prop="assignedunit"
                label="合同单位"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="constructionunit"
                label="建设单位"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="conuttionunit"
                label="施工单位"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="laborserviceunit"
                label="劳务单位"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="medicaldiagnosis"
                label="医学诊断附件"
                width="106"
                show-overflow-tooltip
              >
                <template slot-scope="scope" v-if="scope.row.medicaldiagnosis">
                  <a
                    :href="item"
                    target="_blank"
                    :key="index"
                    v-for="(item, index) in scope.row.medicaldiagnosis.split(
                      '|'
                    )"
                  >
                    {{
                      decodeURIComponent(
                        item.substring(item.lastIndexOf("/") + 1)
                      )
                    }}
                  </a>
                </template>
              </el-table-column>
              <el-table-column
                prop="medicaldiagnosisresult"
                label="医学诊断结果"
                width="200"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column fixed="right" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="redactInjuryRecord(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delInjuryRecord(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <!-- 工伤分页 -->
            <el-pagination
              @size-change="injuryRecordHandleSize"
              @current-change="injuryRecordHandleCurrent"
              :current-page.sync="injuryRecordPageNo"
              :page-size="injuryRecordPageSize"
              layout="total, prev, pager, next, jumper"
              :total="injuryRecordTotal"
              style="margin: 1rem 0"
            >
            </el-pagination>
            <el-dialog
              title="新增工伤记录"
              :visible.sync="addInjuryRecordDialog"
              width="50%"
            >
              <el-form ref="addInjuryRecords" :model="addInjuryRecords">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="time"
                      label="发生时间"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择发生时间',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="addInjuryRecords.time"
                        type="datetime"
                        format="yyyy-MM-dd hh:mm:ss"
                        value-format="yyyy-MM-dd hh:mm:ss"
                        style="width: 100%"
                        placeholder="选择日期时间"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="commercialocation"
                      label="工伤发生地点"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤发生地点',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.commercialocation"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="businesslevel"
                      label="工伤等级"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤等级',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="addInjuryRecords.businesslevel"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('business_level')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="assignedunit"
                      label="合同单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入合同单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.assignedunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="constructionunit"
                      label="建设单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入建设单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.constructionunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="conuttionunit"
                      label="施工单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入施工单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.conuttionunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="laborserviceunit"
                      label="劳务单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入劳务单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.laborserviceunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaldiagnosisresult"
                      label="医学诊断结果"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入医学诊断结果',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addInjuryRecords.medicaldiagnosisresult"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaldiagnosis"
                      label="医学诊断附件"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请上传医学诊断附件',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <!-- :on-preview="(file, fileList) => {$window.location.href =(file.response && file.response.url) || file.url;}" -->
                      <el-upload
                        ref="addInjuryRecordsUpload"
                        :action="`${this.$http.BASE_URL}/dlyrlTest/fileUpload`"
                        :on-preview="
                          (file) => {
                            $window.open(
                              (file.response && file.response.url) || file.url,
                              '_blank'
                            );
                          }
                        "
                        :headers="{ token: $cookie.get('token') }"
                        :on-success="
                          (response, file, fileList) => {
                            addInjuryRecords.medicaldiagnosis = fileList
                              .map(
                                (item) =>
                                  (item.response && item.response.url) ||
                                  item.url
                              )
                              .join('|');
                          }
                        "
                        :on-remove="
                          (file, fileList) => {
                            $http
                              .post(
                                `/dlyrlTest/deleteFile?path=${
                                  (file.response && file.response.url) ||
                                  file.url
                                }`
                              )
                              .then(({ data }) => {
                                $message.success(data.msg);
                              });
                            addInjuryRecords.medicaldiagnosis = fileList
                              .map((item) => item.url)
                              .join('|');
                          }
                        "
                        :before-remove="
                          (file, fileList) => {
                            return $confirm(`确定移除 ${file.name}？`);
                          }
                        "
                        multiple
                        :limit="5"
                        :on-exceed="
                          (files, fileList) => {
                            $message.warning(
                              `当前限制选择 5 个文件，本次选择了 ${
                                files.length
                              } 个文件，共选择了 ${
                                files.length + fileList.length
                              } 个文件`
                            );
                          }
                        "
                        :file-list="addInjuryRecords.fileList"
                      >
                        <el-button size="small" type="primary"
                          >点击上传</el-button
                        >
                        <div slot="tip" class="el-upload__tip">
                          添加相关附件
                        </div>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="chooseAddInjuryRecords">取 消</el-button>
                <el-button type="primary" @click="confirmAddInjuryRecords"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
            <el-dialog
              title="修改工伤记录"
              :visible.sync="redactInjuryRecordDialog"
              width="50%"
            >
              <el-form ref="redactInjuryRecords" :model="redactInjuryRecords">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="time"
                      label="发生时间"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请选择发生时间',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactInjuryRecords.time"
                        type="datetime"
                        format="yyyy-MM-dd hh:mm:ss"
                        value-format="yyyy-MM-dd hh:mm:ss"
                        style="width: 100%"
                        placeholder="选择日期时间"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="commercialocation"
                      label="工伤发生地点"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤发生地点',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.commercialocation"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="businesslevel"
                      label="工伤等级"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤等级',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="redactInjuryRecords.businesslevel"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('business_level')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="assignedunit"
                      label="合同单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入合同单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.assignedunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="constructionunit"
                      label="建设单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入建设单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.constructionunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="conuttionunit"
                      label="施工单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入施工单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.conuttionunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="laborserviceunit"
                      label="劳务单位"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请输入劳务单位',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.laborserviceunit"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaldiagnosisresult"
                      label="医学诊断结果"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入医学诊断结果',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactInjuryRecords.medicaldiagnosisresult"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="medicaldiagnosis"
                      label="医学诊断附件"
                      label-width="110px"
                      :rules="[
                        {
                          required: false,
                          message: '请上传医学诊断附件',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-upload
                        ref="redactInjuryRecordsUpload"
                        :action="`${this.$http.BASE_URL}/dlyrlTest/fileUpload`"
                        :headers="{ token: $cookie.get('token') }"
                        :on-preview="
                          (file) => {
                            $window.open(
                              (file.response && file.response.url) || file.url,
                              '_blank'
                            );
                          }
                        "
                        :on-success="
                          (response, file, fileList) => {
                            redactInjuryRecords.medicaldiagnosis = fileList
                              .map(
                                (item) =>
                                  (item.response && item.response.url) ||
                                  item.url
                              )
                              .join('|');
                          }
                        "
                        :on-remove="
                          (file, fileList) => {
                            $http
                              .post(
                                `/dlyrlTest/deleteFile?path=${
                                  (file.response && file.response.url) ||
                                  file.url
                                }`
                              )
                              .then(({ data }) => {
                                $message.success(data.msg);
                              });
                            redactInjuryRecords.medicaldiagnosis = fileList
                              .map((item) => item.url)
                              .join('|');
                          }
                        "
                        :before-remove="
                          (file, fileList) => {
                            return $confirm(`确定移除 ${file.name}？`);
                          }
                        "
                        multiple
                        :limit="5"
                        :on-exceed="
                          (files, fileList) => {
                            $message.warning(
                              `当前限制选择 5 个文件，本次选择了 ${
                                files.length
                              } 个文件，共选择了 ${
                                files.length + fileList.length
                              } 个文件`
                            );
                          }
                        "
                        :file-list="redactInjuryRecords.fileList"
                      >
                        <el-button size="small" type="primary"
                          >点击上传</el-button
                        >
                        <div slot="tip" class="el-upload__tip">
                          添加相关附件
                        </div>
                      </el-upload>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="redactInjuryRecordDialog = false"
                  >取 消</el-button
                >
                <el-button type="primary" @click="confirmRedactInjuryRecords"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="工资表">
            <!-- 工资表按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="addSalaryByUserDialog = true"
                :disabled="userId == ''"
                >添加
              </el-button>
              <el-button
                type="danger"
                size="small"
                icon="el-icon-delete"
                :disabled="checkSalary.length <= 0"
                @click="delSalarys"
                >批量删除
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseSalary()"
                >取消选择
              </el-button>
              <el-date-picker
                style="margin-left: 10px"
                v-model="salaryPickerValue"
                format="yyyy-MM"
                value-format="yyyy-MM"
                type="month"
                size="small"
                @change="salaryPicker"
                :clearable="false"
              >
              </el-date-picker>
            </div>
            <!-- 工资表数据表格 -->
            <el-table
              :data="salaryTable"
              height="calc(100% - 80px)"
              size="small"
              @selection-change="salaryCheckChange"
              ref="salarys"
              :summary-method="getSummaries"
              show-summary
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
                max-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              v-loading="userSalaryLoading"
              row-key="id"
            >
              <el-table-column
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="salYear"
                label="日期"
                align="center"
                fixed="left"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                  prop="username"
                  label="姓名"
                  align="center"
                  fixed="left"
                  show-overflow-tooltip
                  width="80"
                ></el-table-column>
              <el-table-column label="基本信息">               
                <el-table-column
                  prop="department.name"
                  label="部门"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="job"
                  label="岗位"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <!-- <el-table-column prop="userInformation.bankcard" label="银行卡号" align="center" show-overflow-tooltip></el-table-column> -->
                <el-table-column
                  prop="enterpriseInformation.companyName"
                  label="服务公司"
                  show-overflow-tooltip
                ></el-table-column>
                <!-- <el-table-column prop="idNumber" label="身份证号"></el-table-column> -->
                <!-- <el-table-column prop="phone" label="电话"></el-table-column> -->
              </el-table-column>
              <el-table-column label="考勤 (天)">
                <el-table-column
                  prop="shouldAttendanceDay"
                  label="应出勤"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="travelDays"
                  label="出差"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="leaveDays"
                  label="请假"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="realityAttendanceDay"
                  label="实际出勤"
                  show-overflow-tooltip
                  align="center"
                ></el-table-column>
              </el-table-column>
              <el-table-column label="固定工资 (元)">
                <el-table-column
                  prop="basePay"
                  label="基本工资"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="postWage"
                  label="岗位工资"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="meritPay"
                  label="绩效工资"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="combinedBasic"
                  label="固定合计"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
              </el-table-column>
              <el-table-column label="福利待遇 (元)">
                <el-table-column
                  prop="seniorityPay"
                  label="工龄工资"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="mealAllowance"
                  label="餐费补助"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="trafficAllowance"
                  label="交通补助"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="commission"
                  label="业务提成"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="travelAllowance"
                  label="出差补助"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="attendanceBonus"
                  label="全勤奖"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="overtime"
                  label="加班费"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="communicateSubsidy"
                  label="通信补助"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="otherSupport"
                  label="其他补助"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="totalWelfareBenefits"
                  label="福利合计"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
              </el-table-column>
              <el-table-column
                prop="shouldsalary"
                label="应发工资(元)"
                width="100px"
                align="center"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column label="扣减项目 (元)">
                <el-table-column
                  prop="housingProvidentFund"
                  label="公积金"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="party"
                  label="党费"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="basicOldAgePension"
                  label="基本养老"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="basicMedicalCare"
                  label="基本医疗"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="unemploymentInsurance"
                  label="失业保险"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="individualIncomeTax"
                  label="所得税"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="workInjury"
                  label="工伤"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="lately"
                  label="迟到"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="leaveearly"
                  label="早退"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="absenteeism"
                  label="旷工"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="otherDeductions"
                  label="其他扣款"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="deductionsCombined"
                  label="扣减合计"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
              </el-table-column>
              <el-table-column label="企业保险 (元)">
                <el-table-column
                  prop="providentFund"
                  label="企业公积金"
                  width="100px"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="pension"
                  label="企业养老"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="medical"
                  label="企业医疗"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="unemployment"
                  label="企业失业"
                  align="center"
                  show-overflow-tooltip
                >
                </el-table-column>
                <el-table-column
                  prop="businessInjury"
                  label="企业工伤"
                  align="center"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="otherFee"
                  label="企业其他费用"
                  align="center"
                  width="110px"
                  show-overflow-tooltip
                ></el-table-column>
                <el-table-column
                  prop="totalFees"
                  label="企业费用合计"
                  align="center"
                  width="110px"
                  show-overflow-tooltip
                ></el-table-column>
              </el-table-column>
              <el-table-column
                prop="netPayroll"
                label="实发工资(元)"
                width="100px"
                align="center"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                fixed="right"
                label="操作"
                width="160"
                align="center"
              >
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="updateSalarys(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delSalarys(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <!-- 工资表分页 -->
            <el-pagination
              @size-change="salaryHandleSize"
              @current-change="salaryHandleCurrent"
              :current-page.sync="salaryPageNo"
              :page-size="salaryPageSize"
              layout="total, prev, pager, next, jumper"
              :total="salaryTotal"
              style="margin: 1rem 0"
            >
            </el-pagination>
            <el-dialog
              title="薪资信息"
              :visible.sync="addSalaryByUserDialog"
              width="75%"
            >
              <el-form
                ref="addSalaryByUser"
                :model="addSalaryByUser"
                :rules="rule"
              >
                <el-row style="margin-bottom: 10px">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>基本信息：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="salYear"
                      label="日期："
                      label-width="110px"
                    >
                      <el-date-picker
                        v-model="addSalaryByUser.salYear"
                        format="yyyy-MM"
                        value-format="yyyy-MM"
                        type="month"
                        placeholder="选择日期"
                        style="width: 100%"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="username"
                      label="姓名："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.username"
                        autocomplete="off"
                        disabled
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="phone"
                      label="电话："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.phone"
                        maxlength="11"
                        autocomplete="off"
                        disabled
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="idNumber"
                      label="身份证号："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.idNumber"
                        maxlength="18"
                        autocomplete="off"
                        disabled
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex">
                  <el-col :span="6">
                    <!-- <el-form-item size="small" prop="department" label="部门：" label-width="110px">
							<el-input v-model="addSalaryByUser.department" autocomplete="off" v-on:click.native="Select_Peo" placeholder="请选择部门"></el-input>
						</el-form-item> -->
                    <el-form-item
                      size="small"
                      prop="department"
                      label="部门："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.departmentName"
                        autocomplete="off"
						disabled
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="job"
                      label="岗位："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.job"
						placeholder="岗位"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="bankcard"
                      label="银行卡号："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.bankcard"
                        maxlength="18"
                        autocomplete="off"
                        :disabled="addSalaryByUser.bankcard != ''"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="banknumber"
                      label="银行行号："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.banknumber"
                        autocomplete="off"
                        :disabled="addSalaryByUser.banknumber != ''"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex">
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="openingbank"
                      label="银行开户行："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.openingbank"
                        autocomplete="off"
                        :disabled="addSalaryByUser.openingbank != ''"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>考勤 (天)：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="shouldAttendanceDay"
                      label="应出勤："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.shouldAttendanceDay"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="travelDays"
                      label="出差："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.travelDays"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="leaveDays"
                      label="请假："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.leaveDays"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="realityAttendanceDay"
                      label="实际出勤："
                      label-width="110px"
                    >
                      <span
                        >{{
                          Number(
                            this.addSalaryByUser.shouldAttendanceDay -
                              this.addSalaryByUser.travelDays -
                              this.addSalaryByUser.leaveDays
                          )
                        }}
                        (天)</span
                      >
                      <!-- <el-input autocomplete="off" :disabled="true">{{Number(this.addSalaryByUser.shouldAttendanceDay-this.addSalaryByUser.travelDays-this.addSalaryByUser.leaveDays)}}</el-input> -->
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>固定工资 (元)：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="basePay"
                      label="基本工资："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.basePay"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="postWage"
                      label="岗位工资："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.postWage"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="meritPay"
                      label="绩效工资："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.meritPay"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="combinedBasic"
                      label="固定合计："
                      label-width="110px"
                    >
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.basePay) +
                          Number(this.addSalaryByUser.postWage) +
                          Number(this.addSalaryByUser.meritPay)
                        }}</span
                      >
                      <!-- <el-input v-model="addSalaryByUser.combinedBasic" autocomplete="off" :disabled="true"></el-input> -->
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>福利待遇 (元)：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="seniorityPay"
                      label="工龄工资："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.seniorityPay"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="mealAllowance"
                      label="餐费补助："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.mealAllowance"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="trafficAllowance"
                      label="交通补助："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.trafficAllowance"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="commission"
                      label="业务提成："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.commission"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="travelAllowance"
                      label="出差补助："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.travelAllowance"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="attendanceBonus"
                      label="全勤奖："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.attendanceBonus"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="overtime"
                      label="加班费："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.overtime"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="communicateSubsidy"
                      label="通信补助："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.communicateSubsidy"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="otherSupport"
                      label="其他补助："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.otherSupport"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="totalWelfareBenefits"
                      label="福利合计："
                      label-width="110px"
                    >
                      <!-- <el-input v-model="addSalaryByUser.totalWelfareBenefits" autocomplete="off" :disabled="true"></el-input> -->
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.seniorityPay) +
                          Number(this.addSalaryByUser.mealAllowance) +
                          Number(this.addSalaryByUser.trafficAllowance) +
                          Number(this.addSalaryByUser.commission) +
                          Number(this.addSalaryByUser.travelAllowance) +
                          Number(this.addSalaryByUser.attendanceBonus) +
                          Number(this.addSalaryByUser.overtime) +
                          Number(this.addSalaryByUser.communicateSubsidy) +
                          Number(this.addSalaryByUser.otherSupport)
                        }}</span
                      >
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>扣减合计 (元)：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="basicOldAgePension"
                      label="基本养老："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.basicOldAgePension"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="basicMedicalCare"
                      label="基本医疗："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.basicMedicalCare"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="unemploymentInsurance"
                      label="失业保险："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.unemploymentInsurance"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="housingProvidentFund"
                      label="公积金："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.housingProvidentFund"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="individualIncomeTax"
                      label="所得税："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.individualIncomeTax"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="party"
                      label="党费："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.party"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="workInjury"
                      label="工伤："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.workInjury"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="lately"
                      label="迟到："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.lately"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="leaveearly"
                      label="早退："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.leaveearly"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="absenteeism"
                      label="旷工："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.absenteeism"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="otherDeductions"
                      label="其他扣款："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.otherDeductions"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="deductionsCombined"
                      label="扣减合计："
                      label-width="110px"
                    >
                      <!-- <el-input v-model="addSalaryByUser.deductionsCombined" autocomplete="off" :disabled="true"></el-input> -->
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.basicOldAgePension) +
                          Number(this.addSalaryByUser.basicMedicalCare) +
                          Number(this.addSalaryByUser.unemploymentInsurance) +
                          Number(this.addSalaryByUser.housingProvidentFund) +
                          Number(this.addSalaryByUser.individualIncomeTax) +
                          Number(this.addSalaryByUser.lately) +
                          Number(this.addSalaryByUser.leaveearly) +
                          Number(this.addSalaryByUser.absenteeism) +
                          Number(this.addSalaryByUser.otherDeductions) +
                          Number(this.addSalaryByUser.party) +
                          Number(this.addSalaryByUser.workInjury)
                        }}</span
                      >
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin: 10px 0">
                  <el-col
                    ><span
                      style="font-size: 14px; font-weight: 550; color: #2a8bd8"
                      ><i class="el-icon-menu"></i>企业保险 (元)：</span
                    ></el-col
                  >
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="providentFund"
                      label="企业公积金："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.providentFund"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="pension"
                      label="企业养老："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.pension"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="medical"
                      label="企业医疗："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.medical"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="unemployment"
                      label="企业失业："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.unemployment"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="businessInjury"
                      label="企业工伤："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.businessInjury"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="otherFee"
                      label="企业其他费用："
                      label-width="110px"
                    >
                      <el-input
                        v-model="addSalaryByUser.otherFee"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row type="flex">
                  <el-col :span="4">
                    <el-form-item
                      size="small"
                      prop="totalFees"
                      label="企业费用合计："
                      label-width="110px"
                    >
                      <!-- <el-input v-model="addSalaryByUser.totalFees" autocomplete="off" :disabled="true"></el-input> -->
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.providentFund) +
                          Number(this.addSalaryByUser.pension) +
                          Number(this.addSalaryByUser.medical) +
                          Number(this.addSalaryByUser.unemployment) +
                          Number(this.addSalaryByUser.businessInjury) +
                          Number(this.addSalaryByUser.otherFee)
                        }}
                      </span>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row style="margin-top: 16px; font-weight: 550">
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="shouldsalary"
                      label="应发工资："
                      label-width="110px"
                    >
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.basePay) +
                          Number(this.addSalaryByUser.postWage) +
                          Number(this.addSalaryByUser.meritPay) +
                          (Number(this.addSalaryByUser.seniorityPay) +
                            Number(this.addSalaryByUser.mealAllowance) +
                            Number(this.addSalaryByUser.trafficAllowance) +
                            Number(this.addSalaryByUser.commission) +
                            Number(this.addSalaryByUser.travelAllowance) +
                            Number(this.addSalaryByUser.attendanceBonus) +
                            Number(this.addSalaryByUser.overtime) +
                            Number(this.addSalaryByUser.communicateSubsidy) +
                            Number(this.addSalaryByUser.otherSupport))
                        }}</span
                      >
                      <!-- <el-input v-model="addSalaryByUser.shouldsalary" autocomplete="off" :disabled="true"></el-input> -->
                    </el-form-item>
                  </el-col>
                  <el-col :span="6">
                    <el-form-item
                      size="small"
                      prop="netPayroll"
                      label="实发工资："
                      label-width="110px"
                    >
                      <span
                        >￥{{
                          Number(this.addSalaryByUser.basePay) +
                          Number(this.addSalaryByUser.postWage) +
                          Number(this.addSalaryByUser.meritPay) +
                          (Number(this.addSalaryByUser.seniorityPay) +
                            Number(this.addSalaryByUser.mealAllowance) +
                            Number(this.addSalaryByUser.trafficAllowance) +
                            Number(this.addSalaryByUser.commission) +
                            Number(this.addSalaryByUser.travelAllowance) +
                            Number(this.addSalaryByUser.attendanceBonus) +
                            Number(this.addSalaryByUser.overtime) +
                            Number(this.addSalaryByUser.communicateSubsidy) +
                            Number(this.addSalaryByUser.otherSupport)) -
                          (Number(this.addSalaryByUser.basicOldAgePension) +
                            Number(this.addSalaryByUser.basicMedicalCare) +
                            Number(this.addSalaryByUser.unemploymentInsurance) +
                            Number(this.addSalaryByUser.housingProvidentFund) +
                            Number(this.addSalaryByUser.individualIncomeTax) +
                            Number(this.addSalaryByUser.lately) +
                            Number(this.addSalaryByUser.leaveearly) +
                            Number(this.addSalaryByUser.absenteeism) +
                            Number(this.addSalaryByUser.otherDeductions) +
                            Number(this.addSalaryByUser.party) +
                            Number(this.addSalaryByUser.workInjury))
                        }}</span
                      >
                      <!-- <el-input v-model="addSalaryByUser.netPayroll" autocomplete="off" :disabled="true"></el-input> -->
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button size="small" @click="chooseAddSalary"
                  >取 消</el-button
                >
                <el-button size="small" type="primary" @click="addSalarys"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="公积金">
            <!-- 公积金按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="accumulationFundDialog = true"
                :disabled="userId == ''"
                >添加
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseAccumulationFund()"
                >取消选择
              </el-button>
              <el-date-picker
                style="margin-left: 10px"
                v-model="accumulationFundPickerValue"
                format="yyyy-MM"
                value-format="yyyy-MM"
                type="month"
                size="small"
                @change="accumulationFundPicker"
                :clearable="false"
              >
              </el-date-picker>
            </div>
            <!-- 公积金数据表格 -->
            <el-table
              :data="accumulationFundTable"
              ref="accumulationFund"
              height="calc(100% - 80px)"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              size="mini"
              v-loading="accumulationFundLoading"
              row-key="id"
            >
              <el-table-column
                fixed
                type="selection"
                width="55"
                align="center"
              ></el-table-column>
              <el-table-column
                prop="userinformation.realName"
                label="姓名"
                align="center"
                fixed="left"
                width="80"
              ></el-table-column>
              <el-table-column
                prop="paytime"
                label="缴费日期"
                width="200"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="accountStatus"
                label="账户状态"
                width="100"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("account_status", scope.row.accountStatus, '-') }}
                </template>
              </el-table-column>
              <el-table-column prop="phone" width="110" label="电话">
                <template slot-scope="scope">{{
                  scope.row.phone
                    ? scope.row.phone.replace(
                        /(\d{3})(\d{4})(\d{4})/,
                        "$1****$3"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="companyName.companyName"
                label="单位名称"
                width="220"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="depositBase"
                label="缴存基数"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="companyDepositRatio"
                label="单位缴存比例"
                width="200"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="companyMonthlyDeposit"
                label="单位月缴存额"
                width="200"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="personalDepositRatio"
                label="个人缴存比例"
                width="200"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="personalMonthlyDeposit"
                label="个人月缴存额"
                width="200"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="accountBalance"
                label="账户余额"
                width="100"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column fixed="right" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="redactAccumulationFund(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delAccumulationFund(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <!-- 公积金分页 -->
            <el-pagination
              @size-change="accumulationFundHandleSize"
              @current-change="accumulationFundHandleCurrent"
              :current-page.sync="accumulationFundPageNo"
              :page-size="accumulationFundPageSize"
              layout="total, prev, pager, next, jumper"
              :total="accumulationFundTotal"
              style="margin: 1rem 0"
            >
            </el-pagination>
            <el-dialog
              title="添加公积金"
              :visible.sync="accumulationFundDialog"
            >
              <el-form ref="addAccumulationFunds" :model="addAccumulationFunds">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      label="缴费日期"
                      prop="paytime"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴费日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="addAccumulationFunds.paytime"
                        type="datetime"
                        format="yyyy-MM-dd  hh:mm:ss"
                        value-format="yyyy-MM-dd  hh:mm:ss"
                        placeholder="选择日期"
                        style="width: 100%"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="accountStatus"
                      label="账户状态"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入账户状态',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="addAccumulationFunds.accountStatus"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('account_status')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="accountBalance"
                      label="账户余额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入账户余额(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.accountBalance"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="depositBase"
                      label="缴存基数"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴存基数',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.depositBase"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="companyDepositRatio"
                      label="单位缴存比例"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入单位缴存比例',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.companyDepositRatio"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="companyMonthlyDeposit"
                      label="单位月缴存额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入单位月缴存额(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.companyMonthlyDeposit"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="personalDepositRatio"
                      label="个人缴存比例"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入个人缴存比例',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.personalDepositRatio"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="personalMonthlyDeposit"
                      label="个人月缴存额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入个人月缴存额(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addAccumulationFunds.personalMonthlyDeposit"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="chooseAddAccumulationFunds">取 消</el-button>
                <el-button type="primary" @click="confirmAddAccumulationFunds"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
            <el-dialog
              title="编辑公积金"
              :visible.sync="redactAccumulationFundDialog"
            >
              <el-form
                ref="redactAccumulationFunds"
                :model="redactAccumulationFunds"
              >
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      label="缴费日期"
                      prop="paytime"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴费日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactAccumulationFunds.paytime"
                        type="datetime"
                        format="yyyy-MM-dd  hh:mm:ss"
                        value-format="yyyy-MM-dd  hh:mm:ss"
                        placeholder="选择日期"
                        style="width: 100%"
                      >
                      </el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="accountStatus"
                      label="账户状态"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入账户状态',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-select
                        v-model="redactAccumulationFunds.accountStatus"
                        placeholder="请选择"
                        style="width: 100%"
                      >
                        <el-option
                          v-for="item in $dictUtils.getDictList('account_status')"
                          :key="item.value"
                          :label="item.label"
                          :value="item.value"
                        ></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="accountBalance"
                      label="账户余额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入账户余额',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.accountBalance"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="depositBase"
                      label="缴存基数"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴存基数',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.depositBase"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="companyDepositRatio"
                      label="单位缴存比例"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入单位缴存比例',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.companyDepositRatio"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="companyMonthlyDeposit"
                      label="单位月缴存额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入单位月缴存额',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.companyMonthlyDeposit"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="personalDepositRatio"
                      label="个人缴存比例"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入个人缴存比例',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.personalDepositRatio"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      size="small"
                      prop="personalMonthlyDeposit"
                      label="个人月缴存额"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入个人月缴存额',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactAccumulationFunds.personalMonthlyDeposit"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="redactAccumulationFundDialog = false"
                  >取 消</el-button
                >
                <el-button
                  type="primary"
                  @click="confirmRedactAccumulationFunds"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="社保">
            <!-- 社保按钮 -->
            <div>
              <el-button
                type="primary"
                size="small"
                icon="el-icon-circle-plus-outline"
                @click="addSocialSecurityDialog = true"
                :disabled="userId == ''"
                >添加
              </el-button>
              <el-button
                type="danger"
                size="small"
                icon="el-icon-delete"
                @click="delSocialSecuritys"
                :disabled="checkSocialSecuritys.length <= 0"
                >批量删除
              </el-button>
              <el-button
                size="small"
                icon="el-icon-circle-close"
                @click="chooseSocialSecurity()"
                >取消选择
              </el-button>
              <el-date-picker
                style="margin-left: 10px"
                v-model="socialSecurityPickerValue"
                format="yyyy-MM"
                value-format="yyyy-MM"
                type="month"
                size="small"
                @change="socialSecurityPicker"
                :clearable="false"
              >
              </el-date-picker>
            </div>
            <!-- 社保数据表格 -->
            <el-table
              :data="socialSecurityTable"
              ref="socialSecurity"
              @selection-change="socialSecuritys"
              size="small"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              height="calc(100% - 80px)"
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              v-loading="socialSecurityLoading"
              row-key="id"
            >
              <el-table-column
                fixed
                type="selection"
                align="center"
                width="55"
              ></el-table-column>
              <el-table-column
                prop="userinformation.realName"
                label="姓名"
                align="center"
                fixed="left"
                width="80"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="company.companyName"
                label="单位名称"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="paytime"
                label="缴费日期"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="pension"
                label="养老保险"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="medicalCare"
                label="医疗保险"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="unemployment"
                label="失业保险"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="birth"
                label="生育保险"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="workHurt"
                label="工伤保险"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column fixed="right" label="操作" width="160">
                <template slot-scope="scope">
                  <el-button
                    type="text"
                    icon="el-icon-edit"
                    size="mini"
                    @click="redactSocialSecurity(scope.row)"
                    >修改</el-button
                  >
                  <el-button
                    type="text"
                    icon="el-icon-delete"
                    size="mini"
                    @click="delSocialSecurity(scope.row.id)"
                    >删除</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <!-- 社保分页 -->
            <el-pagination
              @size-change="socialSecurityHandleSize"
              @current-change="socialSecurityHandleCurrent"
              :current-page.sync="socialSecurityPageNo"
              :page-size="socialSecurityPageSize"
              layout="total, prev, pager, next, jumper"
              :total="socialSecurityTotal"
              style="margin: 1rem 0"
            >
            </el-pagination>
            <el-dialog title="添加社保" :visible.sync="addSocialSecurityDialog">
              <el-form ref="addSocialSecuritys" :model="addSocialSecuritys">
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      prop="paytime"
                      size="small"
                      label="缴费日期"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴费日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="addSocialSecuritys.paytime"
                        format="yyyy-MM"
                        value-format="yyyy-MM"
                        type="month"
                        placeholder="选择月"
                        style="width: 100%"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="pension"
                      size="small"
                      label="养老保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入养老保险(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSocialSecuritys.pension"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="medicalCare"
                      size="small"
                      label="医疗保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入医疗保险(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSocialSecuritys.medicalCare"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="unemployment"
                      size="small"
                      label="失业保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入失业保险(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSocialSecuritys.unemployment"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="birth"
                      size="small"
                      label="生育保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入生育保险(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSocialSecuritys.birth"
                        autocomplete="off"
                      ></el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="workHurt"
                      size="small"
                      label="工伤保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤保险(最多保留两位小数)',
                          trigger: 'blur',
                          pattern: /^\d*\.?(\d|\d{2})$/,
                        },
                      ]"
                    >
                      <el-input
                        v-model="addSocialSecuritys.workHurt"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="chooseAddSocialSecuritys">取 消</el-button>
                <el-button type="primary" @click="confirmAddSocialSecuritys"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
            <el-dialog
              title="修改社保"
              :visible.sync="redactSocialSecurityDialog"
            >
              <el-form
                ref="redactSocialSecuritys"
                :model="redactSocialSecuritys"
              >
                <el-row :gutter="15">
                  <el-col :span="12">
                    <el-form-item
                      prop="paytime"
                      size="small"
                      label="缴费日期"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入缴费日期',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-date-picker
                        v-model="redactSocialSecuritys.paytime"
                        format="yyyy-MM"
                        value-format="yyyy-MM"
                        type="month"
                        placeholder="选择月"
                        style="width: 100%"
                      ></el-date-picker>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="pension"
                      size="small"
                      label="养老保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入养老保险',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactSocialSecuritys.pension"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="medicalCare"
                      size="small"
                      label="医疗保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入医疗保险',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactSocialSecuritys.medicalCare"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="unemployment"
                      size="small"
                      label="失业保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入失业保险',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactSocialSecuritys.unemployment"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="birth"
                      size="small"
                      label="生育保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入生育保险',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactSocialSecuritys.birth"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                  <el-col :span="12">
                    <el-form-item
                      prop="workHurt"
                      size="small"
                      label="工伤保险"
                      label-width="110px"
                      :rules="[
                        {
                          required: true,
                          message: '请输入工伤保险',
                          trigger: 'blur',
                        },
                      ]"
                    >
                      <el-input
                        v-model="redactSocialSecuritys.workHurt"
                        autocomplete="off"
                      >
                      </el-input>
                    </el-form-item>
                  </el-col>
                </el-row>
              </el-form>
              <div slot="footer" class="dialog-footer">
                <el-button @click="redactSocialSecurityDialog = false"
                  >取 消</el-button
                >
                <el-button type="primary" @click="confirmRedactSocialSecuritys"
                  >确 定</el-button
                >
              </div>
            </el-dialog>
          </el-tab-pane>
          <el-tab-pane label="简历">
            <!-- 简历数据表格 -->
            <el-table
              :data="resumeTable"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 20px;
                min-height: 380px;
              "
              height="calc(100% - 80px)"
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              size="mini"
              v-loading="resumeLoading"
              row-key="id"
            >
              <el-table-column
                prop="userInformation.realName"
                label="姓名"
                align="center"
                fixed="left"
                width="80"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="userInformation.sex"
                label="性别"
                align="center"
                width="60"
                show-overflow-tooltip
              >
                <!-- <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("sex", scope.row.userInformation.sex, '-') }}
                </template> -->
              </el-table-column>
              <el-table-column
                prop="userInformation.age"
                label="年龄"
                align="center"
                width="60"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="userInformation.email"
                label="邮箱"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="workingYears"
                label="工作经验年限"
                show-overflow-tooltip
                min-width="100"
              ></el-table-column>
              <el-table-column
                prop="graduationdate"
                label="毕业年限"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="workingCity"
                label="期望工作城市"
                show-overflow-tooltip
                min-width="100"
              ></el-table-column>
              <el-table-column
                prop="userInformation.currentAddress"
                label="现住址"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="salaryRequirements"
                label="薪资要求"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="jobSearchingStatus"
                label="求职状态"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("job_searching_status", scope.row.jobSearchingStatus, '-') }}
                </template>
              </el-table-column>
              <el-table-column
                prop="jobPosts"
                label="期望岗位"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="careerObjective"
                label="求职意向"
                show-overflow-tooltip
              >
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="合同">
            <!-- 合同数据表格 -->
            <el-table
              :data="contractTable"
              :cell-style="cellStyle"
              style="
                border: 1px solid #d6cfe2;
                margin-top: 10px;
                min-height: 380px;
              "
              size="mini"
              :header-cell-class-name="cellHeadStyle"
              :row-class-name="tableRowClassName"
              height="calc(100% - 80px)"
              :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
              v-loading="contractLoading"
              row-key="id"
            >
              <el-table-column
                prop="name"
                label="姓名"
                fixed="left"
                show-overflow-tooltip
                width="80"
              ></el-table-column>
              <el-table-column prop="phone" width="110" label="电话">
                <template slot-scope="scope">{{
                  scope.row.phone
                    ? scope.row.phone.replace(
                        /(\d{3})(\d{4})(\d{4})/,
                        "$1****$3"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="idCard"
                label="身份证号"
                width="110"
                show-overflow-tooltip
              >
                <template slot-scope="scope">{{
                  scope.row.idCard
                    ? scope.row.idCard.replace(
                        /^(\d{4})\d+(\d{4})$/,
                        "$1****$2"
                      )
                    : ""
                }}</template>
              </el-table-column>
              <el-table-column
                prop="probationPeriod"
                label="试用期时间"
                min-width="120"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="probationSalary"
                label="试用期薪资"
                min-width="120"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                prop="beginTime"
                label="开始时间"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="endTime"
                label="到期时间"
                show-overflow-tooltip
              ></el-table-column>
              <el-table-column
                prop="userIsSure"
                label="人员是否确认"
                min-width="120"
                show-overflow-tooltip
              >
                <template slot-scope="scope">
                      {{ $dictUtils.getDictLabel("usersure", scope.row.userIsSure, '-') }}
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="人员离职信息"></el-tab-pane>
          <el-tab-pane label="离职流程处理"></el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>
<script>
import tableStyles from "../../../../../utils/mixins.js";
var bankAccountValid = (rule, value, callback) => {
  const strBin =
    "10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99";
  if (!value) {
    return callback(new Error("收款账户不能为空"));
  } else if (!Number.isInteger(+value)) {
    callback(new Error("银行卡号必须全为数字"));
  } else if (value.trim().length < 12 || value.trim().length > 19) {
    callback(new Error("银行卡号长度必须在12到19之间"));
  } else if (strBin.indexOf(value.substring(0, 2)) === -1) {
    callback(new Error("银行卡号开头6位不符合规范"));
  } else {
    callback();
  }
};
export default {
  mixins: [tableStyles],
  data() {
    return {
      personInfoDialog: false, //点击姓名详情弹出层
      personInfo: {
        enterpriseInformation: {
          companyName: "",
        },
        sendenterprise: {
          companyName: "",
        },
        department: {
          name: "",
        },
      }, //详情对象
      valueData: [], //保存省市县的数组
      loading: "",
      dispatchPersonnelSearch: {
        sex: "",
        realName: "",
        sendenterprise: "",
        phone: "",
        currentAddress: "",
      }, // 搜索表单对象
      userId: "", //人员id

      dispatchPersonnelTable: [], //派遣人员数据数组,分页,总条数
      dispatchPersonnelPageNo: 1,
      dispatchPersonnelPageSize: 10,
      dispatchPersonnelTotal: 0,
      dispatchPersonnelLoading: "",
      checkIds: [], //顶部选线卡选中的数组

      attachedListNum: "", //附表选项卡绑定的值
      worksExperienceTable: [], //历史工作记录数据数组
      checkUserHirstyWorks: [], //选中历史工作记录（修改、删除）
      UserHirstyWorkLoading: "",
      insertUserHirstyWorkDialog: false, //新增历史工作记录
      insertUserHirstyWorkList: {
        startTime: "", // 工作开始时间
        endTime: "", // 工作结束时间
        isleaveOffice: "", // 是否正常离职(0是，1否)
        jobs: "", // 岗位
        companyName: "", // 单位名称
        department: "", // 部门
      },
      redactHirstyWorkDialog: false, //编辑历史工作记录
      redactHirstyWork: {
        startTime: "",
        endTime: "",
        isleaveOffice: "",
        jobs: "",
        companyName: "",
        department: "",
      },

      medicalExaminationReportTable: [], //体检报告数据数组
      medicalExaminationReportPageNo: 1, //体检分页，总条数
      medicalExaminationReportPageSize: 4,
      medicalExaminationReportTotal: 0,
      medicalExaminationReportLoading: "",
      checkReports: [], //选中体检报告（修改、删除）
      addSaveHealthMangeDialog: false, //新增体检报告
      addSaveHealthMange: {
        inspectAddress: "",
        inspectTime: "",
        inspectReport: "",
        medicaltype: "",
        medicalaccessory: "",
        userinformation: "",
        fileList: [],
      },
      redactHealthMangeDialog: false, //编辑体检页面
      redactHealthMange: {
        inspectAddress: "",
        inspectTime: "",
        inspectReport: "",
        medicaltype: "",
        medicalaccessory: "",
        userinformation: "",
        fileList: [],
      },

      checkingInTable: [], //考勤数据数组
      checkingInPickerValue: "", //考勤日期
      checkingInLoading: "",

      injuryRecordTable: [], //工伤记录数据数组
      injuryRecordPageNo: 1, //工伤分页，总条数
      injuryRecordPageSize: 4,
      injuryRecordTotal: 0,
      injuryRecordLoading: "",
      checkInjuryRecords: [], //选中工伤记录（修改、删除）
      addInjuryRecordDialog: false, //添加工伤页面
      addInjuryRecords: {
        time: "",
        commercialocation: "",
        businesslevel: "",
        assignedunit: "",
        constructionunit: "",
        conuttionunit: "",
        laborserviceunit: "",
        medicaldiagnosis: "",
        medicaldiagnosisresult: "",
        fileList: [],
      },
      redactInjuryRecordDialog: false, //修改工伤页面
      redactInjuryRecords: {
        time: "",
        commercialocation: "",
        businesslevel: "",
        assignedunit: "",
        constructionunit: "",
        conuttionunit: "",
        laborserviceunit: "",
        medicaldiagnosis: "",
        medicaldiagnosisresult: "",
        fileList: [],
      },

      salaryTable: [], //工资表数据数组
      salaryPageNo: 1, //工资表分页，总条数
      salaryPageSize: 4,
      salaryTotal: 0,
      salaryPickerValue: "", //工资表日期
      userSalaryLoading: "",
      addSalaryByUserDialog: false,
      addSalaryByUser: {
        id: "",
        userInformation: "",
        salYear: "",
        username: "",
        department: "",
        departmentName: "",
        job: "",
        enterpriseInformation: "",
        idNumber: "",
        phone: "",
        shouldAttendanceDay: "",
        travelDays: "",
        leaveDays: "",
        realityAttendanceDay: "",
        basePay: "",
        postWage: "",
        meritPay: "",
        combinedBasic: "",
        seniorityPay: "",
        mealAllowance: "",
        trafficAllowance: "",
        commission: "",
        travelAllowance: "",
        attendanceBonus: "",
        overtime: "",
        communicateSubsidy: "",
        otherSupport: "",
        totalWelfareBenefits: "",
        shouldsalary: "",
        basicOldAgePension: "",
        basicMedicalCare: "",
        unemploymentInsurance: "",
        housingProvidentFund: "",
        individualIncomeTax: "",
        lately: "",
        leaveearly: "",
        absenteeism: "",
        otherDeductions: "",
        deductionsCombined: "",
        netPayroll: "",
        bankcard: "",
        openingbank: "",
        banknumber: "",
        party: "", //党费
        workInjury: "", //工伤扣款
        providentFund: "", //企业公积金
        pension: "", //企业养老
        medical: "", //企业医疗
        unemployment: "", //企业失业
        businessInjury: "", //企业工伤
        otherFee: "", //企业其他费用
        totalFees: "", //企业费用合计
        file: "",
      },
      rule: {
        salYear: {
          required: true,
          message: "请选择日期",
          trigger: "blur",
        },
        username: {
          required: true,
          message: "请选择姓名",
        },
        idNumber: [
          {
            required: true,
            message: "请输入身份证号",
            trigger: "blur",
          },
          {
            min: 15,
            max: 18,
            message: "请输入正确的身份证",
            trigger: "blur",
          },
          {
            required: true,
            pattern:
              /^[1-9][0-9]{5}(18|19|20)[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}([0-9]|(X|x))/,
            message: "请输入正确的身份证",
            trigger: "blur",
          },
        ],
        phone: [
          {
            required: true,
            message: "请输入电话",
            trigger: "blur",
          },
          {
            min: 11,
            max: 11,
            message: "请输入正确的电话",
            trigger: "blur",
          },
          {
            required: true,
            pattern: /(^1[3|4|5|6|7|8|9]\d{9}$)|(^09\d{8}$)/,
            message: "请输入正确的电话",
            trigger: "blur",
          },
        ],
        bankcard: {
          required: true,
          trigger: "blur",
          validator: bankAccountValid,
        },
        openingbank: {
          required: true,
          message: "请输入银行开户行",
          trigger: "blur",
        },
        shouldAttendanceDay: {
          required: true,
          message: "请输入应出勤",
          trigger: "blur",
        },
        travelDays: {
          required: true,
          message: "请输入出差",
          trigger: "blur",
        },
        leaveDays: {
          required: true,
          message: "请输入请假",
          trigger: "blur",
        },
        basePay: {
          required: true,
          message: "请输入基本工资",
          trigger: "blur",
        },
        postWage: {
          required: true,
          message: "请输入岗位工资",
          trigger: "blur",
        },
        meritPay: {
          required: true,
          message: "请输入绩效工资",
          trigger: "blur",
        },
      },
      checkSalary: [], //工资选中行

      accumulationFundTable: [], //公积金数据数组
      accumulationFundPageNo: 1, //公积金分页，总条数
      accumulationFundPageSize: 1,
      accumulationFundTotal: 0,
      accumulationFundPickerValue: "", //公积金日期
      accumulationFundLoading: "",
      accumulationFundDialog: false, //公积金添加页面
      addAccumulationFunds: {
        paytime: "",
        accountStatus: "",
        phone: "",
        depositBase: "",
        companyDepositRatio: "",
        companyMonthlyDeposit: "",
        personalDepositRatio: "",
        personalMonthlyDeposit: "",
        accountBalance: "",
      },
      redactAccumulationFundDialog: false, //公积金编辑页面
      redactAccumulationFunds: {
        paytime: "",
        accountStatus: "",
        phone: "",
        depositBase: "",
        companyDepositRatio: "",
        companyMonthlyDeposit: "",
        personalDepositRatio: "",
        personalMonthlyDeposit: "",
        accountBalance: "",
      },

      socialSecurityTable: [], //社保数据数组
      socialSecurityPageNo: 1, //社保分页，总条数
      socialSecurityPageSize: 1,
      socialSecurityTotal: 0,
      socialSecurityPickerValue: "", //社保日期
      socialSecurityLoading: "",
      checkSocialSecuritys: [], //选中社保（修改、批量删除）
      addSocialSecurityDialog: false, //添加页面
      addSocialSecuritys: {
        userinformation: "",
        company: "",
        paytime: "",
        pension: "",
        medicalCare: "",
        unemployment: "",
        birth: "",
        workHurt: "",
      },
      redactSocialSecurityDialog: false, //编辑页面
      redactSocialSecuritys: {
        userinformation: "",
        company: "",
        paytime: "",
        pension: "",
        medicalCare: "",
        unemployment: "",
        birth: "",
        workHurt: "",
      },

      resumeTable: [], //简历数据数组
      resumeLoading: "",

      contractTable: [], //合同数据数组
      contractLoading: "",
    };
  },
  //合计
  updated() {
    this.$nextTick(() => {
      this.$refs["salarys"].doLayout();
    });
  },
  mounted() {
    this.getCurrentDate();
    this.getSelectUserFound();
    this.cityS();
  },
  methods: {
    searchUsers() {
      //搜索所有人员
      this.dispatchPersonnelLoading = true;
      //判断类似天津或者天津市，切割
      let cityOne = this.dispatchPersonnelSearch.currentAddress.substring(0, 2);
      let cityTwo = this.dispatchPersonnelSearch.currentAddress.substring(3, 5);
      if (cityOne == cityTwo) {
        this.dispatchPersonnelSearch.currentAddress =
          this.dispatchPersonnelSearch.currentAddress.substring(3);
      }
      this.$http({
        url: "/dlyrl/hr/discovery/searchPaiUser",
        method: "get",
        params: {
          pageNo: this.dispatchPersonnelPageNo,
          pageSize: this.dispatchPersonnelPageSize,
          ...this.dispatchPersonnelSearch,
        },
      }).then(({ data }) => {
        // console.log("搜索所有人员",data);
        if (data && data.success) {
          this.dispatchPersonnelTable = data.userInformations;
          this.dispatchPersonnelTotal = data.totalCount;
          this.dispatchPersonnelLoading = false;
        }
      });
    },
    // ------------------------------------------------------
    //查询城市
    cityS() {
      this.$http({
        url: "/sys/area/treeData",
        method: "get",
      }).then(({ data }) => {
        this.valueData = data.treeData[0].children;
      });
    },
    // 搜索城市切换选项
    handleChange(e) {
      this.dispatchPersonnelSearch.currentAddress = e.join("-");
      this.$refs.currentAddressChange.dropDownVisible = false; //监听值发生变化就关闭它
    },
    //点击label也可以进行选择
    handleSelect(event) {
      var that = this;
      this.$nextTick(() => {
        let d = document.getElementsByClassName("cascader1");
        if (d[0] && !d[0].onclick) {
          d[0].onclick = function (e) {
            if (e.target.className == "el-cascader-node__label") {
              e.target.previousElementSibling.click();
            }
          };
        }
      });
    },
    // ------------------------------------------------------
    resetsearchUsers() {
      //重置搜索所有人员
      this.dispatchPersonnelSearch.realName = "";
      this.dispatchPersonnelSearch.phone = "";
      this.dispatchPersonnelSearch.sex = "";
      this.dispatchPersonnelSearch.sendenterprise = "";
      this.$refs.currentAddressChange.handleClear();
      this.getSelectUserFound();
    },

    //顶部选项卡发生变化时
    dispatchPersonnel(val) {
      this.checkIds = [];
      this.checkIds = val;
      this.worksExperienceTable = [];
      this.medicalExaminationReportTable = [];
      this.medicalExaminationReportTotal = 0;
      this.checkingInTable = [];
      this.injuryRecordTable = [];
      this.injuryRecordTotal = 0;
      this.salaryTable = [];
      this.salaryTotal = 0;
      this.accumulationFundTable = [];
      this.accumulationFundTotal = 0;
      this.socialSecurityTable = [];
      this.socialSecurityTotal = 0;
      this.resumeTable = [];
      this.contractTable = [];
      if (this.checkIds.length == 1) {
        this.userId = val[val.length - 1].id;
        this.addSalaryByUser.username = val[val.length - 1].realName;
        this.addSalaryByUser.phone = val[val.length - 1].phone;
        this.addSalaryByUser.idNumber = val[val.length - 1].idCard;
        this.addSalaryByUser.job = val[val.length - 1].gwname;
        this.addSalaryByUser.department = val[val.length - 1].department.id;
        this.addSalaryByUser.departmentName =
          val[val.length - 1].department.name;
        this.addSalaryByUser.bankcard = val[val.length - 1].bankcard;
        this.addSalaryByUser.banknumber = val[val.length - 1].banknumber;
        this.addSalaryByUser.openingbank = val[val.length - 1].openingbank;
      }
      this.handleClick();
    },
    //派遣人员分页
    dispatchPersonnelHandleSize(val) {
      this.dispatchPersonnelPageNo = 1;
      this.dispatchPersonnelPageSize = val;
      this.getSelectUserFound();
    },
    dispatchPersonnelHandleCurrent(val) {
      this.dispatchPersonnelPageNo = val;
      this.getSelectUserFound();
    },
    //查询所有人员
    getSelectUserFound() {
      console.log("进来了");
      this.dispatchPersonnelLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/selectUserAlInformation",
        method: "get",
        params: {
          pageNo: this.dispatchPersonnelPageNo,
          pageSize: this.dispatchPersonnelPageSize,
        },
      }).then(({ data }) => {
        console.log("所有人员", data);
        if (data && data.success) {
          this.dispatchPersonnelTable = data.enterpriseUserList;
          if (this.dispatchPersonnelTable.length == 0) {
            this.dispatchPersonnelTotal = 0;
          } else {
            this.dispatchPersonnelTotal = data.totalCount;
          }
          this.dispatchPersonnelLoading = false;
        }
      });
    },
    //性别字典
    // sexDictionaries(row, column) {
    //   if (row.sex == 0) {
    //     return "男";
    //   } else if (row.sex == 1) {
    //     return "女";
    //   }
    // },
    //取消选择
    deselectUserFound(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.UserFounds.toggleRowSelection(row);
        });
      } else {
        this.$refs.UserFounds.clearSelection();
      }
    },
    editPersonInfo(row) {
      this.personInfoDialog = true;
      this.personInfo = row;
      console.log(row, "row.");
      //性别字典
      if (this.personInfo.sex == 0) {
        this.personInfo.sex = "男";
      } else if (this.personInfo.sex == 1) {
        this.personInfo.sex = "女";
      }
      //学历字典
      if (this.personInfo.education == 1) {
        this.personInfo.education = "中专";
      } else if (this.personInfo.education == 2) {
        this.personInfo.education = "大专";
      } else if (this.personInfo.education == 3) {
        this.personInfo.education = "高中";
      } else if (this.personInfo.education == 4) {
        this.personInfo.education = "本科";
      } else if (this.personInfo.education == 5) {
        this.personInfo.education = "硕士";
      } else if (this.personInfo.education == 6) {
        this.personInfo.education = "博士";
      } else if (this.personInfo.education == 7) {
        this.personInfo.education = "大专";
      }
      //驾照字典
      if (this.personInfo.drivingLicense == "") {
        this.personInfo.drivingLicense = " ";
      } else if (this.personInfo.drivingLicense == 1) {
        this.personInfo.drivingLicense = "A2";
      } else if (this.personInfo.drivingLicense == 10) {
        this.personInfo.drivingLicense = "D";
      } else if (this.personInfo.drivingLicense == 11) {
        this.personInfo.drivingLicense = "E";
      } else if (this.personInfo.drivingLicense == 12) {
        this.personInfo.drivingLicense = "F";
      } else if (this.personInfo.drivingLicense == 13) {
        this.personInfo.drivingLicense = "M";
      } else if (this.personInfo.drivingLicense == 14) {
        this.personInfo.drivingLicense = "N";
      } else if (this.personInfo.drivingLicense == 15) {
        this.personInfo.drivingLicense = "P";
      } else if (this.personInfo.drivingLicense == 2) {
        this.personInfo.drivingLicense = "A3";
      } else if (this.personInfo.drivingLicense == 3) {
        this.personInfo.drivingLicense = "B1";
      } else if (this.personInfo.drivingLicense == 4) {
        this.personInfo.drivingLicense = "B2";
      } else if (this.personInfo.drivingLicense == 5) {
        this.personInfo.drivingLicense = "C1";
      } else if (this.personInfo.drivingLicense == 6) {
        this.personInfo.drivingLicense = "C2";
      } else if (this.personInfo.drivingLicense == 7) {
        this.personInfo.drivingLicense = "C3";
      } else if (this.personInfo.drivingLicense == 8) {
        this.personInfo.drivingLicense = "C4";
      } else if (this.personInfo.drivingLicense == 9) {
        this.personInfo.drivingLicense = "C5";
      } else if (this.personInfo.drivingLicense == 0) {
        this.personInfo.drivingLicense = "A1";
      }
      //求职状态字典
      if (this.personInfo.jobSearchingStatus == 0) {
        this.personInfo.jobSearchingStatus = "离职-随时到岗";
      } else if (this.personInfo.jobSearchingStatus == 1) {
        this.personInfo.jobSearchingStatus = "在职-考虑机会";
      } else if (this.personInfo.jobSearchingStatus == 2) {
        this.personInfo.jobSearchingStatus = "在职-暂不考虑";
      }
      //聘用状态字典
      if (this.personInfo.employmentStatus == 4) {
        this.personInfo.employmentStatus = "已招聘(已签订合同)";
      } else if (this.personInfo.employmentStatus == 5) {
        this.personInfo.employmentStatus = "已聘用(未签订合同)";
      } else if (this.personInfo.employmentStatus == 6) {
        this.personInfo.employmentStatus = "已离职(已解除劳动合同)";
      } else if (this.personInfo.employmentStatus == 7) {
        this.personInfo.employmentStatus = "无聘用关系";
      }
    },
    // ------------------------------------------------------
    //当前日期
    getCurrentDate() {
      var date = new Date();
      var y = date.getFullYear();
      var m =
        date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1;
      var d = date.getDate();
      this.checkingInPickerValue = y + "-" + m + "-" + d; //考勤日期
      this.salaryPickerValue = y + "-" + m; //工资表日期
      this.accumulationFundPickerValue = y + "-" + m; //公积金日期
      this.socialSecurityPickerValue = y + "-" + m; //社保日期
    },
    // ------------------------------------------------------

    //附表tab选项卡
    handleClick() {
      if (this.checkIds.length == 1) {
        switch (this.attachedListNum) {
          case "0":
            this.getUserHirstyWork();
            break;
          case "1":
            this.getMedicalExaminationReport();
            break;
          case "2":
            this.checkingIn();
            break;
          case "3":
            this.getInjuryRecord();
            break;
          case "4":
            this.getUserSalary();
            break;
          case "5":
            this.getAccumulationFund();
            break;
          case "6":
            this.getSocialSecurity();
            break;
          case "7":
            this.getResume();
            break;
          case "8":
            this.getContract();
            break;
          case "9":
            break;
          case "10":
            break;
          default:
            this.getUserHirstyWork();
            break;
        }
      }
    },

    //查询历史工作记录
    getUserHirstyWork() {
      this.UserHirstyWorkLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getUserHirstyWork",
        method: "get",
        params: {
          userId: this.userId,
        },
      }).then(({ data }) => {
        // console.log("历史工作记录",data);
        if (data) {
          this.worksExperienceTable = data.list;
          this.UserHirstyWorkLoading = false;
        }
      });
    },
    //历史工作记录选项卡
    selectUserHirstyWorks(val) {
      this.checkUserHirstyWorks = val;
    },
    //历史记录添加页面取消按钮
    closeInsertUserHirstyWorkDialog() {
      this.insertUserHirstyWorkDialog = false;
      this.$refs["insertUserHirstyWorkLists"].resetFields();
    },
    //历史记录添加页面确认按钮
    insertUserHirstyWorks() {
      //新增历史工作记录
      this.$http({
        url: "/dlyrl/hr/discovery/insertUserHirstyWork",
        method: "post",
        params: {
          userinformation: this.userId,
          beginTime: this.insertUserHirstyWorkList.startTime,
          endingTime: this.insertUserHirstyWorkList.endTime,
          isleaveOffice: this.insertUserHirstyWorkList.isleaveOffice,
          jobs: this.insertUserHirstyWorkList.jobs,
          companyName: this.insertUserHirstyWorkList.companyName,
          department: this.insertUserHirstyWorkList.department,
        },
      }).then(({ data }) => {
        // console.log("新增历史工作记录",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.insertUserHirstyWorkDialog = false;
          this.$refs["insertUserHirstyWorkLists"].resetFields();
          this.getUserHirstyWork();
        }
      });
    },
    //历史工作记录删除
    delUserHirstyWorks() {
      let ids = this.checkUserHirstyWorks
        .map((item) => {
          // console.log(item.id)
          return item.id;
        })
        .join(",");
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delUserHirstyWork",
          method: "post",
          params: {
            ids: ids,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getUserHirstyWork();
          }
        });
      });
    },
    //历史工作记录取消选择
    chooseHirstyWork(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.worksExperience.toggleRowSelection(row);
        });
      } else {
        this.$refs.worksExperience.clearSelection();
      }
    },
    //历史工作记录当前行编辑
    redactInsertUserHirstyWork(row) {
      this.redactHirstyWorkDialog = true;
      this.redactHirstyWork = row;
    },
    //编辑页面确认按钮
    confirmHirstyWorks() {
      this.$http({
        url: "/dlyrl/hr/discovery/insertUserHirstyWork",
        method: "post",
        params: {
          id: this.redactHirstyWork.id,
          userinformation: this.userId,
          beginTime: this.redactHirstyWork.startTime,
          endingTime: this.redactHirstyWork.endTime,
          isleaveOffice: this.redactHirstyWork.isleaveOffice,
          jobs: this.redactHirstyWork.jobs,
          companyName: this.redactHirstyWork.companyName,
          department: this.redactHirstyWork.department,
        },
      }).then(({ data }) => {
        // console.log("编辑历史工作记录",data);
        if (data && data.success) {
          this.$message.success("修改成功");
          this.redactHirstyWorkDialog = false;
          this.getUserHirstyWork();
        }
      });
    },
    //历史工作记录当前行删除
    delInsertUserHirstyWork(id) {
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delUserHirstyWork",
          method: "post",
          params: {
            ids: id,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getUserHirstyWork();
          }
        });
      });
    },

    //体检
    //体检分页
    medicalExaminationReportHandleSize(val) {
      this.medicalExaminationReportPageNo = 1;
      this.medicalExaminationReportPageSize = val;
      this.getMedicalExaminationReport();
    },
    medicalExaminationReportHandleCurrent(val) {
      this.medicalExaminationReportPageNo = val;
      this.getMedicalExaminationReport();
    },
    //查询体检信息
    getMedicalExaminationReport() {
      this.medicalExaminationReportLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getEnterpriseHealth",
        method: "get",
        params: {
          userId: this.userId,
          pageNo: this.medicalExaminationReportPageNo,
          pageSize: this.medicalExaminationReportPageSize,
        },
      }).then(({ data }) => {
        // console.log("体检报告",data);
        if (data) {
          this.medicalExaminationReportTable = data.healthList;
          this.medicalExaminationReportLoading = false;
          if (this.medicalExaminationReportTable.length == 0) {
            this.medicalExaminationReportTotal = 0;
          } else {
            this.medicalExaminationReportTotal = data.totalCount;
          }
        }
      });
    },
    //体检选项卡
    selectmedicalExaminationReport(val) {
      this.checkReports = val;
    },
    //体检添加页面取消按钮
    chooseAddsaveHealthManges() {
      this.addSaveHealthMangeDialog = false;
      this.$refs["addSaveHealthMange"].resetFields();
    },
    //体检添加页面确认按钮
    addsaveHealthManges() {
      this.$http({
        url: "/dlyrl/hr/discovery/saveHealth",
        method: "post",
        file: this.fileFormData,
        params: {
          userinformation: this.userId,
          inspectTime: this.addSaveHealthMange.inspectTime,
          medicaltype: this.addSaveHealthMange.medicaltype,
          inspectAddress: this.addSaveHealthMange.inspectAddress,
          inspectReport: this.addSaveHealthMange.inspectReport,
          medicalaccessory: this.addSaveHealthMange.medicalaccessory,
        },
      }).then(({ data }) => {
        // console.log("新增体检报告",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.addSaveHealthMangeDialog = false;
          this.getMedicalExaminationReport();
          this.$refs["addSaveHealthMange"].resetFields();
          this.$refs.addHealthMangeUpload.clearFiles();
        }
      });
    },
    beforeUpload(file) {
      // console.log(file, "文件");
      this.files = file;
      const extension = file.name.split(".")[1] === "pdf";
      if (!extension) {
        this.$message.warning("上传模板只能是pdf格式!");
        return;
      }
      this.fileName = "";
      this.fileName = file.name;
      return false; // 返回false不会自动上传
    },
    //体检批量删除按钮
    delReports() {
      let ids = this.checkReports
        .map((item) => {
          // console.log(item.id)
          return item.id;
        })
        .join(",");
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delHealth",
          method: "post",
          params: {
            ids: ids,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            const totalPage = Math.ceil(
              (this.medicalExaminationReportTotal - 1) /
                this.medicalExaminationReportPageSize
            );
            this.medicalExaminationReportPageNo =
              totalPage < this.medicalExaminationReportPageNo
                ? totalPage
                : this.medicalExaminationReportPageNo;
            this.medicalExaminationReportPageNo =
              this.medicalExaminationReportPageNo < 1
                ? "1"
                : this.medicalExaminationReportPageNo;
            this.getMedicalExaminationReport();
          }
        });
      });
    },
    //体检取消选择按钮
    chooseReport(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.medicalExaminationReport.toggleRowSelection(row);
        });
      } else {
        this.$refs.medicalExaminationReport.clearSelection();
      }
    },
    //体检当前行编辑按钮
    redactReport(row) {
      this.redactHealthMangeDialog = true;
      this.redactHealthMange = row;
      this.redactHealthMange.fileList = [];
      this.redactHealthMange.medicalaccessory.split("|").forEach((item) => {
        if (item.trim().length > 0) {
          this.redactHealthMange.fileList.push({
            name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
            url: item,
          });
        }
      });
    },
    //编辑页面确认按钮
    confirmRedactHealthMange() {
      this.$http({
        url: "/dlyrl/hr/discovery/updateHealth",
        method: "post",
        params: {
          userinformation: this.userId,
          id: this.redactHealthMange.id,
          inspectTime: this.redactHealthMange.inspectTime,
          medicaltype: this.redactHealthMange.medicaltype,
          inspectAddress: this.redactHealthMange.inspectAddress,
          inspectReport: this.redactHealthMange.inspectReport,
          medicalaccessory: this.redactHealthMange.medicalaccessory,
        },
      }).then(({ data }) => {
        // console.log("编辑体检报告",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.redactHealthMangeDialog = false;
          this.getMedicalExaminationReport();
        }
      });
    },
    //体检当前行删除按钮
    delReport(id) {
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delHealth",
          method: "post",
          params: {
            ids: id,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            const totalPage = Math.ceil(
              (this.medicalExaminationReportTotal - 1) /
                this.medicalExaminationReportPageSize
            );
            this.medicalExaminationReportPageNo =
              totalPage < this.medicalExaminationReportPageNo
                ? totalPage
                : this.medicalExaminationReportPageNo;
            this.medicalExaminationReportPageNo =
              this.medicalExaminationReportPageNo < 1
                ? "1"
                : this.medicalExaminationReportPageNo;
            this.getMedicalExaminationReport();
          }
        });
      });
    },

    //考勤查询
    checkingIn() {
      this.checkingInLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getCheckin",
        method: "get",
        params: {
          userId: this.userId,
          date: this.checkingInPickerValue,
        },
      }).then(({ data }) => {
        // console.log("考勤",data);
        if (data) {
          this.checkingInTable = data.checkinRecordList;
          this.checkingInLoading = false;
        }
      });
    },
    //考勤日期改变重新调用
    checkingInPicker(val) {
      this.checkingInPickerValue = val;
      this.checkingIn();
    },

    //工伤
    //工伤分页
    injuryRecordHandleSize(val) {
      this.injuryRecordPageNo = 1;
      this.injuryRecordPageSize = val;
      this.getInjuryRecord();
    },
    injuryRecordHandleCurrent(val) {
      this.injuryRecordPageNo = val;
      this.getInjuryRecord();
    },
    //工伤查询接口
    getInjuryRecord() {
      this.injuryRecordLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/selectUserInformationIsHire",
        method: "get",
        params: {
          userId: this.userId,
          pageNo: this.injuryRecordPageNo,
          pageSize: this.injuryRecordPageSize,
        },
      }).then(({ data }) => {
        // console.log("工伤",data);
        if (data) {
          this.injuryRecordTable = data.workList;
          this.injuryRecordLoading = false;
          if (this.injuryRecordTable.length == 0) {
            this.injuryRecordTotal = 0;
          } else {
            this.injuryRecordTotal = data.totalCount;
          }
        }
      });
    },
    //工伤选项卡
    selectInjuryRecord(val) {
      this.checkInjuryRecords = val;
    },
    //工伤添加页面取消按钮
    chooseAddInjuryRecords() {
      this.addInjuryRecordDialog = false;
      this.$refs["addInjuryRecords"].resetFields();
    },
    //工伤添加页面确定按钮
    confirmAddInjuryRecords() {
      this.$http({
        url: "/dlyrl/hr/discovery/saveWorkInjury",
        method: "post",
        params: {
          userinformation: this.userId,
          date: this.addInjuryRecords.time,
          commercialocation: this.addInjuryRecords.commercialocation,
          businesslevel: this.addInjuryRecords.businesslevel,
          assignedunit: this.addInjuryRecords.assignedunit,
          constructionunit: this.addInjuryRecords.constructionunit,
          conuttionunit: this.addInjuryRecords.conuttionunit,
          laborserviceunit: this.addInjuryRecords.laborserviceunit,
          medicaldiagnosis: this.addInjuryRecords.medicaldiagnosis,
          medicaldiagnosisresult: this.addInjuryRecords.medicaldiagnosisresult,
        },
      }).then(({ data }) => {
        // console.log("新增工伤",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.addInjuryRecordDialog = false;
          this.getInjuryRecord();
          this.$refs["addInjuryRecords"].resetFields();
          this.$refs.addInjuryRecordsUpload.clearFiles();
        }
      });
    },
    //工伤批量删除按钮
    delInjuryRecords() {
      let ids = this.checkInjuryRecords
        .map((item) => {
          // console.log(item.id)
          return item.id;
        })
        .join(",");
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delWorkInjury",
          method: "post",
          params: {
            ids: ids,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getInjuryRecord();
          }
        });
      });
    },
    //工伤记录取消选择按钮
    chooseInjuryRecord(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.injuryRecord.toggleRowSelection(row);
        });
      } else {
        this.$refs.injuryRecord.clearSelection();
      }
    },
    //工伤当前行编辑按钮
    redactInjuryRecord(row) {
      this.redactInjuryRecordDialog = true;
      this.redactInjuryRecords = row;
      this.redactInjuryRecords.fileList = [];
      this.redactInjuryRecords.medicaldiagnosis.split("|").forEach((item) => {
        if (item.trim().length > 0) {
          this.redactInjuryRecords.fileList.push({
            name: decodeURIComponent(item.substring(item.lastIndexOf("/") + 1)),
            url: item,
          });
        }
      });
    },
    //工伤修改页面确认按钮
    confirmRedactInjuryRecords() {
      this.$http({
        url: "/dlyrl/hr/discovery/updateWorkInjury",
        method: "post",
        params: {
          userinformation: this.userId,
          date: this.redactInjuryRecords.time,
          commercialocation: this.redactInjuryRecords.commercialocation,
          businesslevel: this.redactInjuryRecords.businesslevel,
          assignedunit: this.redactInjuryRecords.assignedunit,
          constructionunit: this.redactInjuryRecords.constructionunit,
          conuttionunit: this.redactInjuryRecords.conuttionunit,
          laborserviceunit: this.redactInjuryRecords.laborserviceunit,
          medicaldiagnosis: this.redactInjuryRecords.medicaldiagnosis,
          medicaldiagnosisresult:
            this.redactInjuryRecords.medicaldiagnosisresult,
          id: this.redactInjuryRecords.id,
        },
      }).then(({ data }) => {
        // console.log("修改工伤",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.redactInjuryRecordDialog = false;
          this.getInjuryRecord();
        }
      });
    },
    //工伤当前行删除按钮
    delInjuryRecord(id) {
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delWorkInjury",
          method: "post",
          params: {
            ids: id,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getInjuryRecord();
          }
        });
      });
    },

    //工资表日期改变重新调用
    salaryPicker(val) {
      this.salaryPickerValue = val;
      this.getUserSalary();
    },
    //工资选项卡
    salaryCheckChange(val) {
      this.checkSalary = val;
    },
    //工资表分页
    salaryHandleSize(val) {
      this.salaryPageSize = val;
      this.salaryPageNo = 1;
      this.getUserSalary();
    },
    salaryHandleCurrent(val) {
      this.salaryPageSize = val;
      this.getUserSalary();
    },
    //工资表查询
    getUserSalary() {
      this.userSalaryLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getUserSalary",
        method: "get",
        params: {
          userId: this.userId,
          pageNo: this.salaryPageNo,
          pageSize: this.salaryPageSize,
        },
      }).then(({ data }) => {
        // console.log("工资表",data);
        if (data) {
          this.salaryTable = data.page;
          this.userSalaryLoading = false;
          if (this.salaryTable.length == 0) {
            this.salaryTotal = 0;
          } else {
            this.salaryTotal = data.totalCount;
          }
        }
      });
    },
    //工资添加页面取消按钮
    chooseAddSalary() {
      this.addSalaryByUserDialog = false;
      this.$refs["addSalaryByUser"].resetFields();
    },
    //工资添加页面确认按钮
    addSalarys() {
      this.addSalaryByUserDialog = true;
      this.$refs.addSalaryByUser.validate((valid) => {
        if (valid) {
          this.$http({
            url: "/dlyrl/hr/discovery/addSalary",
            method: "post",
            params: {
              id: this.addSalaryByUser.id,
              userinformation: this.userId,
              salYear: this.addSalaryByUser.salYear,
              openingbank: this.addSalaryByUser.openingbank,
              banknumber: this.addSalaryByUser.banknumber,
              bankcard: this.addSalaryByUser.bankcard,
              department: this.addSalaryByUser.department,
              job: this.addSalaryByUser.job,
              enterpriseInformation: this.addSalaryByUser.enterpriseInformation,
              idNumber: this.addSalaryByUser.idNumber,
              phone: this.addSalaryByUser.phone,
              shouldAttendanceDay: this.addSalaryByUser.shouldAttendanceDay,
              travelDays: this.addSalaryByUser.travelDays,
              leaveDays: this.addSalaryByUser.leaveDays,
              realityAttendanceDay: Number(
                this.addSalaryByUser.shouldAttendanceDay -
                  this.addSalaryByUser.travelDays -
                  this.addSalaryByUser.leaveDays
              ),
              basePay: this.addSalaryByUser.basePay,
              postWage: this.addSalaryByUser.postWage,
              meritPay: this.addSalaryByUser.meritPay,
              combinedBasic:
                Number(this.addSalaryByUser.basePay) +
                Number(this.addSalaryByUser.postWage) +
                Number(this.addSalaryByUser.meritPay),
              seniorityPay: this.addSalaryByUser.seniorityPay,
              mealAllowance: this.addSalaryByUser.mealAllowance,
              trafficAllowance: this.addSalaryByUser.trafficAllowance,
              commission: this.addSalaryByUser.commission,
              travelAllowance: this.addSalaryByUser.travelAllowance,
              attendanceBonus: this.addSalaryByUser.attendanceBonus,
              overtime: this.addSalaryByUser.overtime,
              communicateSubsidy: this.addSalaryByUser.communicateSubsidy,
              otherSupport: this.addSalaryByUser.otherSupport,
              totalWelfareBenefits:
                Number(this.addSalaryByUser.seniorityPay) +
                Number(this.addSalaryByUser.mealAllowance) +
                Number(this.addSalaryByUser.trafficAllowance) +
                Number(this.addSalaryByUser.commission) +
                Number(this.addSalaryByUser.travelAllowance) +
                Number(this.addSalaryByUser.attendanceBonus) +
                Number(this.addSalaryByUser.overtime) +
                Number(this.addSalaryByUser.communicateSubsidy) +
                Number(this.addSalaryByUser.otherSupport),
              shouldsalary:
                Number(this.addSalaryByUser.basePay) +
                Number(this.addSalaryByUser.postWage) +
                Number(this.addSalaryByUser.meritPay) +
                (Number(this.addSalaryByUser.seniorityPay) +
                  Number(this.addSalaryByUser.mealAllowance) +
                  Number(this.addSalaryByUser.trafficAllowance) +
                  Number(this.addSalaryByUser.commission) +
                  Number(this.addSalaryByUser.travelAllowance) +
                  Number(this.addSalaryByUser.attendanceBonus) +
                  Number(this.addSalaryByUser.overtime) +
                  Number(this.addSalaryByUser.communicateSubsidy) +
                  Number(this.addSalaryByUser.otherSupport)),
              basicOldAgePension: this.addSalaryByUser.basicOldAgePension,
              basicMedicalCare: this.addSalaryByUser.basicMedicalCare,
              unemploymentInsurance: this.addSalaryByUser.unemploymentInsurance,
              housingProvidentFund: this.addSalaryByUser.housingProvidentFund,
              individualIncomeTax: this.addSalaryByUser.individualIncomeTax,
              lately: this.addSalaryByUser.lately,
              leaveearly: this.addSalaryByUser.leaveearly,
              absenteeism: this.addSalaryByUser.absenteeism,
              otherDeductions: this.addSalaryByUser.otherDeductions,
              party: this.addSalaryByUser.party,
              workInjury: this.addSalaryByUser.workInjury,
              providentFund: this.addSalaryByUser.providentFund,
              pension: this.addSalaryByUser.pension,
              medical: this.addSalaryByUser.medical,
              unemployment: this.addSalaryByUser.unemployment,
              businessInjury: this.addSalaryByUser.businessInjury,
              otherFee: this.addSalaryByUser.otherFee,
              deductionsCombined:
                Number(this.addSalaryByUser.basicOldAgePension) +
                Number(this.addSalaryByUser.basicMedicalCare) +
                Number(this.addSalaryByUser.unemploymentInsurance) +
                Number(this.addSalaryByUser.housingProvidentFund) +
                Number(this.addSalaryByUser.individualIncomeTax) +
                Number(this.addSalaryByUser.lately) +
                Number(this.addSalaryByUser.leaveearly) +
                Number(this.addSalaryByUser.absenteeism) +
                Number(this.addSalaryByUser.otherDeductions) +
                Number(this.addSalaryByUser.party) +
                Number(this.addSalaryByUser.workInjury),
              totalFees:
                Number(this.addSalaryByUser.providentFund) +
                Number(this.addSalaryByUser.pension) +
                Number(this.addSalaryByUser.medical) +
                Number(this.addSalaryByUser.unemployment) +
                Number(this.addSalaryByUser.businessInjury) +
                Number(this.addSalaryByUser.otherFee),
              netPayroll:
                Number(this.addSalaryByUser.basePay) +
                Number(this.addSalaryByUser.postWage) +
                Number(this.addSalaryByUser.meritPay) +
                (Number(this.addSalaryByUser.seniorityPay) +
                  Number(this.addSalaryByUser.mealAllowance) +
                  Number(this.addSalaryByUser.trafficAllowance) +
                  Number(this.addSalaryByUser.commission) +
                  Number(this.addSalaryByUser.travelAllowance) +
                  Number(this.addSalaryByUser.attendanceBonus) +
                  Number(this.addSalaryByUser.overtime) +
                  Number(this.addSalaryByUser.communicateSubsidy) +
                  Number(this.addSalaryByUser.otherSupport)) -
                (Number(this.addSalaryByUser.basicOldAgePension) +
                  Number(this.addSalaryByUser.basicMedicalCare) +
                  Number(this.addSalaryByUser.unemploymentInsurance) +
                  Number(this.addSalaryByUser.housingProvidentFund) +
                  Number(this.addSalaryByUser.individualIncomeTax) +
                  Number(this.addSalaryByUser.lately) +
                  Number(this.addSalaryByUser.leaveearly) +
                  Number(this.addSalaryByUser.absenteeism) +
                  Number(this.addSalaryByUser.otherDeductions) +
                  Number(this.addSalaryByUser.party) +
                  Number(this.addSalaryByUser.workInjury)),
            },
          }).then(({ data }) => {
            // console.log("工资表",data);
            if (data && data.success) {
              this.$message.success(data.msg);
              this.addSalaryByUserDialog = false;
              this.$refs["addSalaryByUser"].resetFields();
              this.getUserSalary();
            }
          });
        }
      });
    },
    //工资表删除按钮
    delSalarys(id) {
      let ids = "";
      if (this.checkSalary.length > 0) {
        ids = this.checkSalary
          .map((item) => {
            return item.id;
          })
          .join(",");
      } else {
        ids = id;
      }
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delSalary",
          method: "post",
          params: {
            salaryIds: ids,
          },
        }).then(({ data }) => {
          this.$message.success(data.msg);
          this.getUserSalary();
        });
      });
    },
    //工资表编辑按钮
    updateSalarys(val) {
      this.addSalaryByUserDialog = true;
      this.addSalaryByUser.id = val.id;
      this.addSalaryByUser.enterpriseInformation = val.enterpriseInformation.id;
      this.addSalaryByUser.salYear = val.salYear;
      this.addSalaryByUser.username = val.username;
      (this.addSalaryByUser.department = val.department.id),
        (this.addSalaryByUser.departmentName = val.department.name);
      this.addSalaryByUser.job = val.job;
      this.addSalaryByUser.idNumber = val.idNumber;
      this.addSalaryByUser.phone = val.phone;
      this.addSalaryByUser.shouldAttendanceDay = val.shouldAttendanceDay;
      this.addSalaryByUser.travelDays = val.travelDays;
      this.addSalaryByUser.leaveDays = val.leaveDays;
      // this.addSalaryByUser.realityAttendanceDay=val.realityAttendanceDay;
      (this.addSalaryByUser.basePay = val.basePay),
        (this.addSalaryByUser.postWage = val.postWage);
      this.addSalaryByUser.meritPay = val.meritPay;
      this.addSalaryByUser.combinedBasic = val.combinedBasic;
      this.addSalaryByUser.seniorityPay = val.seniorityPay;
      this.addSalaryByUser.mealAllowance = val.mealAllowance;
      this.addSalaryByUser.trafficAllowance = val.trafficAllowance;
      this.addSalaryByUser.commission = val.commission;
      this.addSalaryByUser.travelAllowance = val.travelAllowance;
      this.addSalaryByUser.attendanceBonus = val.attendanceBonus;
      this.addSalaryByUser.overtime = val.overtime;
      this.addSalaryByUser.communicateSubsidy = val.communicateSubsidy;
      this.addSalaryByUser.otherSupport = val.otherSupport;
      // this.addSalaryByUser.totalWelfareBenefits=val.totalWelfareBenefits;
      // this.addSalaryByUser.shouldsalary=val.shouldsalary;
      this.addSalaryByUser.basicOldAgePension = val.basicOldAgePension;
      this.addSalaryByUser.basicMedicalCare = val.basicMedicalCare;
      this.addSalaryByUser.unemploymentInsurance = val.unemploymentInsurance;
      this.addSalaryByUser.housingProvidentFund = val.housingProvidentFund;
      this.addSalaryByUser.individualIncomeTax = val.individualIncomeTax;
      this.addSalaryByUser.lately = val.lately;
      this.addSalaryByUser.leaveearly = val.leaveearly;
      this.addSalaryByUser.absenteeism = val.absenteeism;
      this.addSalaryByUser.otherDeductions = val.otherDeductions;
      // this.addSalaryByUser.deductionsCombined=val.deductionsCombined;
      // this.addSalaryByUser.netPayroll=val.netPayroll;

      // this.addSalaryByUser.bankcard=val.userinformation.bankcard;
      // this.addSalaryByUser.openingbank=val.userinformation.openingbank;
      // this.addSalaryByUser.banknumber=val.userinformation.banknumber;
      this.addSalaryByUser.party = val.party;
      this.addSalaryByUser.workInjury = val.workInjury;
      this.addSalaryByUser.providentFund = val.providentFund;
      this.addSalaryByUser.pension = val.pension;
      this.addSalaryByUser.medical = val.medical;
      this.addSalaryByUser.unemployment = val.unemployment;
      this.addSalaryByUser.businessInjury = val.businessInjury;
      this.addSalaryByUser.otherFee = val.otherFee;
      // totalFees:"",//企业费用合计
    },
    //工资取消选择
    chooseSalary(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.salarys.toggleRowSelection(row);
        });
      } else {
        this.$refs.salarys.clearSelection();
      }
    },

    //公积金日期改变重新调用
    accumulationFundPicker(val) {
      this.accumulationFundPickerValue = val;
      this.getAccumulationFund();
    },
    //公积金分页
    accumulationFundHandleSize(val) {
      this.accumulationFundPageNo = 1;
      this.accumulationFundPageSize = val;
      this.getAccumulationFund();
    },
    accumulationFundHandleCurrent(val) {
      this.accumulationFundPageNo = val;
      this.getAccumulationFund();
    },
    //查询公积金
    getAccumulationFund() {
      this.accumulationFundLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getAccumulationFund",
        method: "get",
        params: {
          userId: this.userId,
          pageNo: this.accumulationFundPageNo,
          pageSize: this.accumulationFundPageSize,
          date: this.accumulationFundPickerValue,
        },
      }).then(({ data }) => {
        // console.log("公积金",data);
        if (data) {
          this.accumulationFundTable = data.accfundList;
          this.accumulationFundLoading = false;
          this.accumulationFundTotal = data.totalCount;
        }
      });
    },
    //公积金添加页面取消按钮
    chooseAddAccumulationFunds() {
      this.accumulationFundDialog = false;
      this.$refs["addAccumulationFunds"].resetFields();
    },
    //公积金添加页面确认按钮
    confirmAddAccumulationFunds() {
      this.$http({
        url: "/dlyrl/hr/discovery/addAccumulationFund",
        method: "post",
        params: {
          date: this.addAccumulationFunds.paytime,
          userinformation: this.userId,
          individualAccount: this.addAccumulationFunds.individualAccount,
          accountStatus: this.addAccumulationFunds.accountStatus,
          depositBase: this.addAccumulationFunds.depositBase,
          companyDepositRatio: this.addAccumulationFunds.companyDepositRatio,
          companyMonthlyDeposit:
            this.addAccumulationFunds.companyMonthlyDeposit,
          personalDepositRatio: this.addAccumulationFunds.personalDepositRatio,
          personalMonthlyDeposit:
            this.addAccumulationFunds.personalMonthlyDeposit,
          accountBalance: this.addAccumulationFunds.accountBalance,
        },
      }).then(({ data }) => {
        // console.log("公积金添加页面",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.accumulationFundDialog = false;
          this.$refs["addAccumulationFunds"].resetFields();
          this.getAccumulationFund();
        }
      });
    },
    //取消选择
    chooseAccumulationFund(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.accumulationFund.toggleRowSelection(row);
        });
      } else {
        this.$refs.accumulationFund.clearSelection();
      }
    },
    //公积金当前行编辑按钮
    redactAccumulationFund(row) {
      this.redactAccumulationFundDialog = true;
      this.redactAccumulationFunds = row;
    },
    //公积金编辑页面确认按钮
    confirmRedactAccumulationFunds() {
      this.$http({
        url: "/dlyrl/hr/discovery/addAccumulationFund",
        method: "post",
        params: {
          date: this.redactAccumulationFunds.paytime,
          userinformation: this.userId,
          id: this.redactAccumulationFunds.id,
          individualAccount: this.redactAccumulationFunds.individualAccount,
          accountStatus: this.redactAccumulationFunds.accountStatus,
          depositBase: this.redactAccumulationFunds.depositBase,
          companyDepositRatio: this.redactAccumulationFunds.companyDepositRatio,
          companyMonthlyDeposit:
            this.redactAccumulationFunds.companyMonthlyDeposit,
          personalDepositRatio:
            this.redactAccumulationFunds.personalDepositRatio,
          personalMonthlyDeposit:
            this.redactAccumulationFunds.personalMonthlyDeposit,
          accountBalance: this.redactAccumulationFunds.accountBalance,
        },
      }).then(({ data }) => {
        // console.log("公积金编辑机页面",data);
        if (data && data.success) {
          this.$message.success("修改成功");
          this.redactAccumulationFundDialog = false;
          this.getAccumulationFund();
        }
      });
    },
    //公积金当前行删除按钮
    delAccumulationFund(id) {
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delAccumulationFund",
          method: "post",
          params: {
            fundIds: id,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getAccumulationFund();
          }
        });
      });
    },

    //社保日期改变重新调用
    socialSecurityPicker(val) {
      this.socialSecurityPickerValue = val;
      this.getSocialSecurity();
    },
    //社保分页
    socialSecurityHandleSize(val) {
      this.socialSecurityPageSize = val;
      this.socialSecurityPageNo = 1;
      this.getSocialSecurity();
    },
    socialSecurityHandleCurrent(val) {
      this.socialSecurityPageNo = val;
      this.getSocialSecurity();
    },
    //社保选项卡
    socialSecuritys(val) {
      this.checkSocialSecuritys = val;
    },
    //查询社保
    getSocialSecurity() {
      this.socialSecurityLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/getSocialSecuCompany",
        method: "get",
        params: {
          userId: this.userId,
          pageNo: this.socialSecurityPageNo,
          pageSize: this.socialSecurityPageSize,
          date: this.socialSecurityPickerValue,
        },
      }).then(({ data }) => {
        // console.log("社保",data);
        if (data) {
          this.socialSecurityTable = data.page;
          this.socialSecurityLoading = false;
          if (this.socialSecurityTable.length == 0) {
            this.socialSecurityTotal = 0;
          } else {
            this.socialSecurityTotal = data.totalCount;
          }
        }
      });
    },
    //社保添加取消按钮
    chooseAddSocialSecuritys() {
      this.addSocialSecurityDialog = false;
      this.$refs["addSocialSecuritys"].resetFields();
    },
    //社保添加确认按钮
    confirmAddSocialSecuritys() {
      this.$http({
        url: "/dlyrl/hr/discovery/addSocialSecuCompany",
        method: "post",
        params: {
          paytime: this.addSocialSecuritys.paytime,
          userinformation: this.userId,
          pension: this.addSocialSecuritys.pension,
          medicalCare: this.addSocialSecuritys.medicalCare,
          unemployment: this.addSocialSecuritys.unemployment,
          birth: this.addSocialSecuritys.birth,
          workHurt: this.addSocialSecuritys.workHurt,
        },
      }).then(({ data }) => {
        // console.log("社保添加页面",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.addSocialSecurityDialog = false;
          this.$refs["addSocialSecuritys"].resetFields();
          this.getSocialSecurity();
        }
      });
    },
    //社保批量删除按钮
    delSocialSecuritys() {
      let ids = this.checkSocialSecuritys
        .map((item) => {
          // console.log(item.id)
          return item.id;
        })
        .join(",");
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delSocialSecuCompany",
          method: "post",
          params: {
            socialIds: ids,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getSocialSecurity();
          }
        });
      });
    },
    //社保取消按钮
    chooseSocialSecurity(rows) {
      if (rows) {
        rows.forEach((row) => {
          this.$refs.socialSecurity.toggleRowSelection(row);
        });
      } else {
        this.$refs.socialSecurity.clearSelection();
      }
    },
    //社保当前行编辑按钮
    redactSocialSecurity(row) {
      this.redactSocialSecuritys = row;
      this.redactSocialSecurityDialog = true;
    },
    //社保编辑页面确认按钮
    confirmRedactSocialSecuritys() {
      this.$http({
        url: "/dlyrl/hr/discovery/addSocialSecuCompany",
        method: "post",
        params: {
          paytime: this.redactSocialSecuritys.paytime,
          userinformation: this.userId,
          pension: this.redactSocialSecuritys.pension,
          medicalCare: this.redactSocialSecuritys.medicalCare,
          unemployment: this.redactSocialSecuritys.unemployment,
          birth: this.redactSocialSecuritys.birth,
          workHurt: this.redactSocialSecuritys.workHurt,
          id: this.redactSocialSecuritys.id,
        },
      }).then(({ data }) => {
        // console.log("社保修改页面",data);
        if (data && data.success) {
          this.$message.success(data.msg);
          this.redactSocialSecurityDialog = false;
          this.getSocialSecurity();
        }
      });
    },
    //社保当前行删除按钮
    delSocialSecurity(id) {
      this.$confirm(`确定删除所选项吗?`, "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        this.$http({
          url: "/dlyrl/hr/discovery/delSocialSecuCompany",
          method: "post",
          params: {
            socialIds: id,
          },
        }).then(({ data }) => {
          if (data && data.success) {
            this.$message.success(data.msg);
            this.getSocialSecurity();
          }
        });
      });
    },

    //简历查询
    getResume() {
      this.resumeLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/selectUserInformationResume",
        method: "get",
        params: {
          userId: this.userId,
        },
      }).then(({ data }) => {
        // console.log("简历",data);
        if (data) {
          this.resumeTable = data.resumeInformation;
          this.resumeLoading = false;
        }
      });
    },

    //合同查询
    getContract() {
      this.contractLoading = true;
      this.$http({
        url: "/dlyrl/hr/discovery/selectUserContract",
        method: "get",
        params: {
          userId: this.userId,
        },
      }).then(({ data }) => {
        // console.log("合同",data);
        if (data) {
          this.contractTable = data.contractUser;
          this.contractLoading = false;
        }
      });
    },
  },
};
</script>
